snapshot_testing 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/snapshot_testing/rspec.rb +18 -5
- data/lib/snapshot_testing/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c0173565a679feb7e8d03a0e923a802a9c055c9
|
4
|
+
data.tar.gz: fbd67bf868bae0746277f5edf511fdf995701d51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdc86b7cc34b4d205a47cb9534cefc90d6a48809e64c250a9dacec66dac3b618704f8bf5e08734d71aa757472e2610a8450961d1c9187ab694e09a03741cf1f8
|
7
|
+
data.tar.gz: da3655e165f158a0cc2c24510ba3483a162e4470b3a68c97ebb6c97834ed26a2c1218c80e2fed7024018473a6a784bbc0386f20820cf970e35a3c81a29c25b1c
|
@@ -29,14 +29,27 @@ module SnapshotTesting
|
|
29
29
|
@expected == @actual
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
diffable
|
33
|
+
description { "match snapshot #{expected_formatted}"}
|
33
34
|
|
34
35
|
failure_message do
|
35
|
-
|
36
|
+
"\nexpected: #{expected_formatted}\n got: #{actual_formatted}\n"
|
37
|
+
end
|
38
|
+
|
39
|
+
def expected
|
40
|
+
@expected
|
41
|
+
end
|
42
|
+
|
43
|
+
def expected_formatted
|
44
|
+
::RSpec::Support::ObjectFormatter.format(expected)
|
45
|
+
end
|
46
|
+
|
47
|
+
def actual
|
48
|
+
@actual
|
49
|
+
end
|
36
50
|
|
37
|
-
|
38
|
-
|
39
|
-
message
|
51
|
+
def actual_formatted
|
52
|
+
::RSpec::Support::ObjectFormatter.format(actual)
|
40
53
|
end
|
41
54
|
end
|
42
55
|
end
|