rspec-rcv 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/rspec-rcv/configuration.rb +12 -1
- data/lib/rspec-rcv/handler.rb +3 -2
- data/lib/rspec-rcv/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44d98b7ddc7311d283c7022a29fa68e55f41b37f
|
4
|
+
data.tar.gz: 31b1cda827810877cce8c8c8563a19ced1d56008
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58decdc1e4c9a8e31b067d8c034df1e70fe260460ba67979d7906930e4b8b4dd9cd1b189867937dc0e1c8a5035cba1f7a164eea62aeb7b0e24eef437935b4468
|
7
|
+
data.tar.gz: a22332bdec3be25a9872dec8fd0eb74eff04c37893b759913138aa196087c557f116b1c4b9b5e9abea05e6a1ecc966577c8eaa468b38caa81cff6667b9affd07
|
@@ -9,7 +9,10 @@ module RSpecRcv
|
|
9
9
|
ignore_keys: [],
|
10
10
|
fail_on_changed_output: true,
|
11
11
|
base_path: nil,
|
12
|
-
fixture: nil
|
12
|
+
fixture: nil,
|
13
|
+
parse_existing: Proc.new do |existing|
|
14
|
+
existing["data"]
|
15
|
+
end
|
13
16
|
}
|
14
17
|
|
15
18
|
def initialize
|
@@ -78,5 +81,13 @@ module RSpecRcv
|
|
78
81
|
def fail_on_changed_output=(val)
|
79
82
|
@opts[:fail_on_changed_output] = val
|
80
83
|
end
|
84
|
+
|
85
|
+
def parse_existing
|
86
|
+
@opts[:parse_existing]
|
87
|
+
end
|
88
|
+
|
89
|
+
def parse_existing=(val)
|
90
|
+
@opts[:parse_existing] = val
|
91
|
+
end
|
81
92
|
end
|
82
93
|
end
|
data/lib/rspec-rcv/handler.rb
CHANGED
@@ -16,10 +16,11 @@ module RSpecRcv
|
|
16
16
|
output = opts[:codec].export_with(output) + "\n"
|
17
17
|
|
18
18
|
if existing_data
|
19
|
-
|
19
|
+
existing_data_comparison = opts.fetch(:parse_existing).call(existing_data)
|
20
|
+
eq = opts[:compare_with].call(existing_data_comparison, data, opts)
|
20
21
|
|
21
22
|
if !eq && opts[:fail_on_changed_output]
|
22
|
-
raise_error!(output, JsonCompare.get_diff(
|
23
|
+
raise_error!(output, JsonCompare.get_diff(existing_data_comparison, data, opts.fetch(:ignore_keys, [])))
|
23
24
|
end
|
24
25
|
|
25
26
|
return :same if eq
|
data/lib/rspec-rcv/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-rcv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Bussey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
139
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.
|
140
|
+
rubygems_version: 2.2.2
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Export results of rspec tests to disk for integration testing.
|