Skip to content

Relax the protocol requirement for Snapshotting extension #998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Snapshotting<UIView, UIImage>.image
We can define an `image` strategy on `UIViewController` using the `pullback` method:

``` swift
extension Snapshotting where Value == UIViewController, Format == UIImage {
extension Snapshotting where Value: UIViewController, Format == UIImage {
public static let image: Snapshotting = Snapshotting<UIView, UIImage>
.image
.pullback { viewController in viewController.view }
Expand Down
4 changes: 2 additions & 2 deletions Sources/SnapshotTesting/Snapshotting/NSView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import AppKit
import Cocoa

extension Snapshotting where Value == NSView, Format == NSImage {
extension Snapshotting where Value: NSView Format == NSImage {
/// A snapshot strategy for comparing views based on pixel equality.
public static var image: Snapshotting {
return .image()
Expand Down Expand Up @@ -47,7 +47,7 @@
}
}

extension Snapshotting where Value == NSView, Format == String {
extension Snapshotting where Value: NSView, Format == String {
/// A snapshot strategy for comparing views based on a recursive description of their properties
/// and hierarchies.
///
Expand Down
4 changes: 2 additions & 2 deletions Sources/SnapshotTesting/Snapshotting/NSViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import AppKit
import Cocoa

extension Snapshotting where Value == NSViewController, Format == NSImage {
extension Snapshotting where Value: NSViewController, Format == NSImage {
/// A snapshot strategy for comparing view controller views based on pixel equality.
public static var image: Snapshotting {
return .image()
Expand All @@ -26,7 +26,7 @@
}
}

extension Snapshotting where Value == NSViewController, Format == String {
extension Snapshotting where Value: NSViewController, Format == String {
/// A snapshot strategy for comparing view controller views based on a recursive description of
/// their properties and hierarchies.
public static var recursiveDescription: Snapshotting {
Expand Down
4 changes: 2 additions & 2 deletions Sources/SnapshotTesting/Snapshotting/UIView.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if os(iOS) || os(tvOS)
import UIKit

extension Snapshotting where Value == UIView, Format == UIImage {
extension Snapshotting where Value: UIView, Format == UIImage {
/// A snapshot strategy for comparing views based on pixel equality.
public static var image: Snapshotting {
return .image()
Expand Down Expand Up @@ -44,7 +44,7 @@
}
}

extension Snapshotting where Value == UIView, Format == String {
extension Snapshotting where Value: UIView, Format == String {
/// A snapshot strategy for comparing views based on a recursive description of their properties
/// and hierarchies.
///
Expand Down
4 changes: 2 additions & 2 deletions Sources/SnapshotTesting/Snapshotting/UIViewController.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if os(iOS) || os(tvOS)
import UIKit

extension Snapshotting where Value == UIViewController, Format == UIImage {
extension Snapshotting where Value: UIViewController, Format == UIImage {
/// A snapshot strategy for comparing view controller views based on pixel equality.
public static var image: Snapshotting {
return .image()
Expand Down Expand Up @@ -83,7 +83,7 @@
}
}

extension Snapshotting where Value == UIViewController, Format == String {
extension Snapshotting where Value: UIViewController, Format == String {
/// A snapshot strategy for comparing view controllers based on their embedded controller
/// hierarchy.
///
Expand Down