snapshot_testing 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34fda2f98525f2de25ae45b78c943965afae17b2
4
- data.tar.gz: 488bab370972b35f7b891b11012abdcd1b68bb23
3
+ metadata.gz: 0c0173565a679feb7e8d03a0e923a802a9c055c9
4
+ data.tar.gz: fbd67bf868bae0746277f5edf511fdf995701d51
5
5
  SHA512:
6
- metadata.gz: 2e1927abd0956bb9a001c690e2ab53789e443003a3eded4ead50f13281b7378a92bc837f5477c996c0f019e5232262dda2714c57e23d93a262faf436b09e389b
7
- data.tar.gz: 4a46591f6322bed4702efea3531795b183514a467d8204f2abf6f0c82ee8ffc7b65cad608752fa38fa78aea1de4556d284c883ecbfeb5813bfc9fc065901cc18
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
- description { "match snapshot #{@expected.inspect}"}
32
+ diffable
33
+ description { "match snapshot #{expected_formatted}"}
33
34
 
34
35
  failure_message do
35
- diff = ::RSpec::Expectations.differ.diff(@actual, @expected)
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
- message = "\nexpected: #{@expected.inspect}\n got: #{@actual.inspect}\n"
38
- message = "#{message}\nDiff: #{diff}" unless diff.strip.empty?
39
- message
51
+ def actual_formatted
52
+ ::RSpec::Support::ObjectFormatter.format(actual)
40
53
  end
41
54
  end
42
55
  end
@@ -1,3 +1,3 @@
1
1
  module SnapshotTesting
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapshot_testing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ray Zane