rspec-snapshot 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: fb0c8d8ece5fdf281b87a40702c0c307fbc9acc4
4
- data.tar.gz: 6a597e4338164f74256c34b1520535f9cd6dfa40
2
+ SHA256:
3
+ metadata.gz: 5ad0d5d187025c941d709184e5dc59c3bc0c4a3b8930e968da9542c73a554b51
4
+ data.tar.gz: 2c7b8ea85fee0876131d0fa8fa2f9daaf1be595befd9dd5a362f879d385f6ad1
5
5
  SHA512:
6
- metadata.gz: 8a26cc6d87062aa93ca016e4c292ba135efaa41f137a2454a34fc1973d900f9d45eea9eee8ce6299c1b42d94067e1db89e4c15348566d42d8cf4cc77fb6c81f2
7
- data.tar.gz: 2f14f63bd2604709434ec5cdf86f3db655f10e82c0450fc05bf6ddff0335ad23abef8b40531b488a647a6a1d9fab60aec2f4319ca0cbfe8718c8e58ae1f54d27
6
+ metadata.gz: 05567f1f4c658a9d065c73634fcd73944f4263ac3616fe220db65e527f1b318ab5ecd3e7fde35fbc5234cde50c9f842541653b94fecf33baedcfb43a95c3ccb0
7
+ data.tar.gz: 18a7088b304ee61b2fc8d1a2bb8d63ebbd2cf29949c63f30dbb226461a35d3ddfd104104e586bf1e4b2e00252362ce45ca73d4f42d05f380b3767bcb70862663
@@ -4,6 +4,8 @@ module RSpec
4
4
  module Snapshot
5
5
  module Matchers
6
6
  class MatchSnapShot
7
+ attr_reader :actual, :expected
8
+
7
9
  def initialize(metadata, snapshot_name)
8
10
  @metadata = metadata
9
11
  @snapshot_name = snapshot_name
@@ -16,9 +18,9 @@ module RSpec
16
18
  FileUtils.mkdir_p(File.dirname(snap_path)) unless Dir.exist?(File.dirname(snap_path))
17
19
  if File.exist?(snap_path)
18
20
  file = File.new(snap_path)
19
- @expect = file.read
21
+ @expected = file.read
20
22
  file.close
21
- @actual == @expect
23
+ @actual.to_s == @expected
22
24
  else
23
25
  RSpec.configuration.reporter.message "Generate #{snap_path}"
24
26
  file = File.new(snap_path, "w+")
@@ -28,9 +30,12 @@ module RSpec
28
30
  end
29
31
  end
30
32
 
33
+ def diffable?
34
+ true
35
+ end
31
36
 
32
37
  def failure_message
33
- "\nexpected: #{@expect}\n got: #{@actual}\n"
38
+ "\nexpected: #{@expected}\n got: #{@actual}\n"
34
39
  end
35
40
 
36
41
  def snapshot_dir
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Snapshot
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-snapshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wei Zhu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-14 00:00:00.000000000 Z
11
+ date: 2019-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -119,8 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubyforge_project:
123
- rubygems_version: 2.6.8
122
+ rubygems_version: 3.0.3
124
123
  signing_key:
125
124
  specification_version: 4
126
125
  summary: RSpec Snapshot Matcher