@@ -26,12 +26,16 @@ class SnapshotTestingTests: TestCase {
2626 struct User { let id : Int , name : String , bio : String }
2727 let user = User ( id: 1 , name: " Blobby " , bio: " Blobbed around the world. " )
2828 assertSnapshot ( matching: user, as: . dump)
29- assertSnapshot ( matching: Data ( " Hello, world! " . utf8) , as: . dump)
30- assertSnapshot ( matching: URL ( string: " https://www.pointfree.co " ) !, as: . dump)
3129 }
3230
33- func testDate( ) {
34- assertSnapshot ( matching: Date ( timeIntervalSinceReferenceDate: 0 ) , as: . dump)
31+ func testAnySnapshotStringConvertible( ) {
32+ assertSnapshot ( matching: " a " as Character , as: . dump, named: " character " )
33+ assertSnapshot ( matching: Data ( " Hello, world! " . utf8) , as: . dump, named: " data " )
34+ assertSnapshot ( matching: Date ( timeIntervalSinceReferenceDate: 0 ) , as: . dump, named: " date " )
35+ assertSnapshot ( matching: NSObject ( ) , as: . dump, named: " nsobject " )
36+ assertSnapshot ( matching: " Hello, world! " , as: . dump, named: " string " )
37+ assertSnapshot ( matching: " Hello, world! " . dropLast ( 8 ) , as: . dump, named: " substring " )
38+ assertSnapshot ( matching: URL ( string: " https://www.pointfree.co " ) !, as: . dump, named: " url " )
3539 }
3640
3741 func testDeterministicDictionaryAndSetSnapshots( ) {
@@ -89,10 +93,6 @@ class SnapshotTestingTests: TestCase {
8993 assertSnapshot ( matching: user, as: . dump, named: " named " )
9094 }
9195
92- func testNSObject( ) {
93- assertSnapshot ( matching: NSObject ( ) , as: . dump)
94- }
95-
9696 func testNSView( ) {
9797 #if os(macOS)
9898 let button = NSButton ( )
@@ -472,13 +472,12 @@ extension SnapshotTestingTests {
472472 static var allTests : [ ( String , ( SnapshotTestingTests ) -> ( ) throws -> Void ) ] {
473473 return [
474474 ( " testAny " , testAny) ,
475- ( " testDate " , testDate ) ,
475+ ( " testAnySnapshotStringConvertible " , testAnySnapshotStringConvertible ) ,
476476 ( " testDeterministicDictionaryAndSetSnapshots " , testDeterministicDictionaryAndSetSnapshots) ,
477477 ( " testEncodable " , testEncodable) ,
478478 ( " testMixedViews " , testMixedViews) ,
479479 ( " testMultipleSnapshots " , testMultipleSnapshots) ,
480480 ( " testNamedAssertion " , testNamedAssertion) ,
481- ( " testNSObject " , testNSObject) ,
482481 ( " testPrecision " , testPrecision) ,
483482 ( " testSCNView " , testSCNView) ,
484483 ( " testSKView " , testSKView) ,
0 commit comments