@@ -66,7 +66,7 @@ A snapshot strategy that captures a value's textual description from `String`'s
66
66
#### Example:
67
67
68
68
``` swift
69
- assertSnapshot (matching : user, as : .description )
69
+ assertSnapshot (of : user, as : .description )
70
70
```
71
71
72
72
Records:
@@ -90,7 +90,7 @@ You can hook into how an instance of a type is rendered in this strategy by conf
90
90
#### Example:
91
91
92
92
``` swift
93
- assertSnapshot (matching : user, as : .dump )
93
+ assertSnapshot (of : user, as : .dump )
94
94
```
95
95
96
96
Records:
@@ -124,10 +124,10 @@ A snapshot strategy for comparing layers based on pixel equality.
124
124
125
125
``` swift
126
126
// Match reference perfectly.
127
- assertSnapshot (matching : layer, as : .image )
127
+ assertSnapshot (of : layer, as : .image )
128
128
129
129
// Allow for a 1% pixel difference.
130
- assertSnapshot (matching : layer, as : .image (precision : 0.99 ))
130
+ assertSnapshot (of : layer, as : .image (precision : 0.99 ))
131
131
```
132
132
133
133
## CaseIterable
@@ -160,7 +160,7 @@ enum Direction: String, CaseIterable {
160
160
}
161
161
162
162
assertSnapshot (
163
- matching : { $0 .rotatedLeft },
163
+ of : { $0 .rotatedLeft },
164
164
as : Snapshotting< Direction, String > .func (into : .description )
165
165
)
166
166
```
@@ -194,10 +194,10 @@ A snapshot strategy for comparing paths based on pixel equality.
194
194
195
195
``` swift
196
196
// Match reference perfectly.
197
- assertSnapshot (matching : path, as : .image )
197
+ assertSnapshot (of : path, as : .image )
198
198
199
199
// Allow for a 1% pixel difference.
200
- assertSnapshot (matching : path, as : .image (precision : 0.99 ))
200
+ assertSnapshot (of : path, as : .image (precision : 0.99 ))
201
201
```
202
202
203
203
### ` .elementsDescription `
@@ -216,10 +216,10 @@ A snapshot strategy for comparing paths based on a description of their elements
216
216
217
217
``` swift
218
218
// Match reference perfectly.
219
- assertSnapshot (matching : path, as : .elementsDescription )
219
+ assertSnapshot (of : path, as : .elementsDescription )
220
220
221
221
// Match reference as formatted by formatter.
222
- assertSnapshot (matching : path, as : .elementsDescription (numberFormatter : NumberFormatter ()))
222
+ assertSnapshot (of : path, as : .elementsDescription (numberFormatter : NumberFormatter ()))
223
223
```
224
224
225
225
## Data
@@ -233,7 +233,7 @@ A snapshot strategy for comparing bare binary data.
233
233
#### Example:
234
234
235
235
``` swift
236
- assertSnapshot (matching : data, as : .data )
236
+ assertSnapshot (of : data, as : .data )
237
237
```
238
238
239
239
## Encodable
@@ -253,7 +253,7 @@ A snapshot strategy for comparing encodable structures based on their JSON repre
253
253
#### Example:
254
254
255
255
``` swift
256
- assertSnapshot (matching : user, as : .json )
256
+ assertSnapshot (of : user, as : .json )
257
257
```
258
258
259
259
Records:
@@ -279,7 +279,7 @@ A snapshot strategy for comparing encodable structures based on their property l
279
279
#### Example:
280
280
281
281
``` swift
282
- assertSnapshot (matching : user, as : .plist )
282
+ assertSnapshot (of : user, as : .plist )
283
283
```
284
284
285
285
Records:
@@ -319,10 +319,10 @@ A snapshot strategy for comparing paths based on pixel equality.
319
319
320
320
``` swift
321
321
// Match reference perfectly.
322
- assertSnapshot (matching : path, as : .image )
322
+ assertSnapshot (of : path, as : .image )
323
323
324
324
// Allow for a 1% pixel difference.
325
- assertSnapshot (matching : path, as : .image (precision : 0.99 ))
325
+ assertSnapshot (of : path, as : .image (precision : 0.99 ))
326
326
```
327
327
328
328
### ` .elementsDescription `
@@ -341,10 +341,10 @@ A snapshot strategy for comparing paths based on a description of their elements
341
341
342
342
``` swift
343
343
// Match reference perfectly.
344
- assertSnapshot (matching : path, as : .elementsDescription )
344
+ assertSnapshot (of : path, as : .elementsDescription )
345
345
346
346
// Match reference as formatted by formatter.
347
- assertSnapshot (matching : path, as : .elementsDescription (numberFormatter : NumberFormatter ()))
347
+ assertSnapshot (of : path, as : .elementsDescription (numberFormatter : NumberFormatter ()))
348
348
```
349
349
350
350
## NSImage
@@ -367,10 +367,10 @@ A snapshot strategy for comparing images based on pixel equality.
367
367
368
368
``` swift
369
369
// Match reference as-is.
370
- assertSnapshot (matching : image, as : .image )
370
+ assertSnapshot (of : image, as : .image )
371
371
372
372
// Allow for a 1% pixel difference.
373
- assertSnapshot (matching : image, as : .image (precision : 0.99 ))
373
+ assertSnapshot (of : image, as : .image (precision : 0.99 ))
374
374
```
375
375
376
376
## NSView
@@ -401,14 +401,14 @@ A snapshot strategy for comparing layers based on pixel equality.
401
401
402
402
``` swift
403
403
// Match reference as-is.
404
- assertSnapshot (matching : view, as : .image )
404
+ assertSnapshot (of : view, as : .image )
405
405
406
406
// Allow for a 1% pixel difference.
407
- assertSnapshot (matching : view, as : .image (precision : 0.99 ))
407
+ assertSnapshot (of : view, as : .image (precision : 0.99 ))
408
408
409
409
// Render at a certain size.
410
410
assertSnapshot (
411
- matching : view,
411
+ of : view,
412
412
as : .image (size : .init (width : 44 , height : 44 ))
413
413
)
414
414
```
@@ -422,7 +422,7 @@ A snapshot strategy for comparing views based on a recursive description of thei
422
422
#### Example
423
423
424
424
``` swift
425
- assertSnapshot (matching : view, as : .recursiveDescription )
425
+ assertSnapshot (of : view, as : .recursiveDescription )
426
426
```
427
427
428
428
Records:
@@ -458,14 +458,14 @@ A snapshot strategy for comparing layers based on pixel equality.
458
458
459
459
``` swift
460
460
// Match reference as-is.
461
- assertSnapshot (matching : vc, as : .image )
461
+ assertSnapshot (of : vc, as : .image )
462
462
463
463
// Allow for a 1% pixel difference.
464
- assertSnapshot (matching : vc, as : .image (precision : 0.99 ))
464
+ assertSnapshot (of : vc, as : .image (precision : 0.99 ))
465
465
466
466
// Render at a certain size.
467
467
assertSnapshot (
468
- matching : vc,
468
+ of : vc,
469
469
as : .image (size : .init (width : 640 , height : 480 ))
470
470
)
471
471
```
@@ -481,7 +481,7 @@ A snapshot strategy for comparing view controller views based on a recursive des
481
481
#### Example
482
482
483
483
``` swift
484
- assertSnapshot (matching : vc, as : .recursiveDescription )
484
+ assertSnapshot (of : vc, as : .recursiveDescription )
485
485
```
486
486
487
487
Records:
@@ -515,7 +515,7 @@ A snapshot strategy for comparing SceneKit scenes based on pixel equality.
515
515
516
516
``` swift
517
517
assertSnapshot (
518
- matching : scene,
518
+ of : scene,
519
519
as : .image (size : .init (width : 640 , height : 480 ))
520
520
)
521
521
```
@@ -544,7 +544,7 @@ A snapshot strategy for comparing SpriteKit scenes based on pixel equality.
544
544
545
545
``` swift
546
546
assertSnapshot (
547
- matching : scene,
547
+ of : scene,
548
548
as : .image (size : .init (width : 640 , height : 480 ))
549
549
)
550
550
```
@@ -564,7 +564,7 @@ A snapshot strategy for comparing strings based on equality.
564
564
#### Example:
565
565
566
566
``` swift
567
- assertSnapshot (matching : htmlString, as : .lines )
567
+ assertSnapshot (of : htmlString, as : .lines )
568
568
```
569
569
570
570
## UIBezierPath
@@ -587,10 +587,10 @@ A snapshot strategy for comparing paths based on pixel equality.
587
587
588
588
``` swift
589
589
// Match reference perfectly.
590
- assertSnapshot (matching : path, as : .image )
590
+ assertSnapshot (of : path, as : .image )
591
591
592
592
// Allow for a 1% pixel difference.
593
- assertSnapshot (matching : path, as : .image (precision : 0.99 ))
593
+ assertSnapshot (of : path, as : .image (precision : 0.99 ))
594
594
```
595
595
596
596
### ` .elementsDescription `
@@ -609,10 +609,10 @@ A snapshot strategy for comparing paths based on a description of their elements
609
609
610
610
``` swift
611
611
// Match reference perfectly.
612
- assertSnapshot (matching : path, as : .elementsDescription )
612
+ assertSnapshot (of : path, as : .elementsDescription )
613
613
614
614
// Match reference as formatted by formatter.
615
- assertSnapshot (matching : path, as : .elementsDescription (numberFormatter : NumberFormatter ()))
615
+ assertSnapshot (of : path, as : .elementsDescription (numberFormatter : NumberFormatter ()))
616
616
```
617
617
618
618
## UIImage
@@ -635,10 +635,10 @@ A snapshot strategy for comparing images based on pixel equality.
635
635
636
636
``` swift
637
637
// Match reference as-is.
638
- assertSnapshot (matching : image, as : .image )
638
+ assertSnapshot (of : image, as : .image )
639
639
640
640
// Allow for a 1% pixel difference.
641
- assertSnapshot (matching : image, as : .image (precision : 0.99 ))
641
+ assertSnapshot (of : image, as : .image (precision : 0.99 ))
642
642
```
643
643
644
644
## UIView
@@ -677,20 +677,20 @@ A snapshot strategy for comparing layers based on pixel equality.
677
677
678
678
``` swift
679
679
// Match reference as-is.
680
- assertSnapshot (matching : view, as : .image )
680
+ assertSnapshot (of : view, as : .image )
681
681
682
682
// Allow for a 1% pixel difference.
683
- assertSnapshot (matching : view, as : .image (precision : 0.99 ))
683
+ assertSnapshot (of : view, as : .image (precision : 0.99 ))
684
684
685
685
// Render at a certain size.
686
686
assertSnapshot (
687
- matching : view,
687
+ of : view,
688
688
as : .image (size : .init (width : 44 , height : 44 ))
689
689
)
690
690
691
691
// Render with a horizontally-compact size class.
692
692
assertSnapshot (
693
- matching : view,
693
+ of : view,
694
694
as : .image (traits : .init (horizontalSizeClass : .regular ))
695
695
)
696
696
```
@@ -715,13 +715,13 @@ A snapshot strategy for comparing views based on a recursive description of thei
715
715
716
716
``` swift
717
717
// Layout on the current device.
718
- assertSnapshot (matching : view, as : .recursiveDescription )
718
+ assertSnapshot (of : view, as : .recursiveDescription )
719
719
720
720
// Layout with a certain size.
721
- assertSnapshot (matching : view, as : .recursiveDescription (size : .init (width : 22 , height : 22 )))
721
+ assertSnapshot (of : view, as : .recursiveDescription (size : .init (width : 22 , height : 22 )))
722
722
723
723
// Layout with a certain trait collection.
724
- assertSnapshot (matching : view, as : .recursiveDescription (traits : .init (horizontalSizeClass : .regular )))
724
+ assertSnapshot (of : view, as : .recursiveDescription (traits : .init (horizontalSizeClass : .regular )))
725
725
```
726
726
727
727
Records:
@@ -744,7 +744,7 @@ A snapshot strategy for comparing view controllers based on their embedded contr
744
744
#### Example
745
745
746
746
``` swift
747
- assertSnapshot (matching : vc, as : .hierarchy )
747
+ assertSnapshot (of : vc, as : .hierarchy )
748
748
```
749
749
750
750
Records:
@@ -802,28 +802,28 @@ A snapshot strategy for comparing layers based on pixel equality.
802
802
803
803
``` swift
804
804
// Match reference as-is.
805
- assertSnapshot (matching : vc, as : .image )
805
+ assertSnapshot (of : vc, as : .image )
806
806
807
807
// Allow for a 1% pixel difference.
808
- assertSnapshot (matching : vc, as : .image (precision : 0.99 ))
808
+ assertSnapshot (of : vc, as : .image (precision : 0.99 ))
809
809
810
810
// Render as if on a certain device.
811
- assertSnapshot (matching : vc, as : .image (on : .iPhoneX (.portrait )))
811
+ assertSnapshot (of : vc, as : .image (on : .iPhoneX (.portrait )))
812
812
813
813
// Render at a certain size.
814
814
assertSnapshot (
815
- matching : vc,
815
+ of : vc,
816
816
as : .image (size : .init (width : 375 , height : 667 ))
817
817
)
818
818
819
819
// Render with a horizontally-compact size class.
820
820
assertSnapshot (
821
- matching : vc,
821
+ of : vc,
822
822
as : .image (traits : .init (horizontalSizeClass : .compact ))
823
823
)
824
824
825
825
// Match reference as-is.
826
- assertSnapshot (matching : vc, as : .image )
826
+ assertSnapshot (of : vc, as : .image )
827
827
```
828
828
829
829
** See also** : [ ` UIView ` ] ( #uiview ) .
@@ -852,10 +852,10 @@ A snapshot strategy for comparing view controller views based on a recursive des
852
852
853
853
``` swift
854
854
// Layout on the current device.
855
- assertSnapshot (matching : vc, as : .recursiveDescription )
855
+ assertSnapshot (of : vc, as : .recursiveDescription )
856
856
857
857
// Layout as if on a certain device.
858
- assertSnapshot (matching : vc, as : .recursiveDescription (on : .iPhoneSe (.portrait )))
858
+ assertSnapshot (of : vc, as : .recursiveDescription (on : .iPhoneSe (.portrait )))
859
859
```
860
860
861
861
Records:
@@ -878,7 +878,7 @@ A snapshot strategy for comparing requests based on a cURL representation.
878
878
#### Example:
879
879
880
880
``` swift
881
- assertSnapshot (matching : request, as : .curl )
881
+ assertSnapshot (of : request, as : .curl )
882
882
```
883
883
884
884
Records:
@@ -900,7 +900,7 @@ A snapshot strategy for comparing requests based on raw equality.
900
900
#### Example:
901
901
902
902
``` swift
903
- assertSnapshot (matching : request, as : .raw )
903
+ assertSnapshot (of : request, as : .raw )
904
904
```
905
905
906
906
Records:
0 commit comments