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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7f7ef0b816b8ffa81a6688ed6fc90b75f7d05be
4
- data.tar.gz: 1c91a8426617d6653bf3e950bb9e2b3bb88498f6
3
+ metadata.gz: 44d98b7ddc7311d283c7022a29fa68e55f41b37f
4
+ data.tar.gz: 31b1cda827810877cce8c8c8563a19ced1d56008
5
5
  SHA512:
6
- metadata.gz: 064bd72d4c9ee31f49558dfe3a8699ad1b597c6e0ca3a2a51745be7b0998f1682c03079dd1dc139838c40852f7153f9c3986c9d6ada963616e409c1f360d4efa
7
- data.tar.gz: a0a3b38024c03f308398df8e4c219aefcc2cc5c3b76e12a7c5e5f806252dd3016bab9c6e82dcde2792e6a9c2acb2381467909fe56491dd479e8308cece6d62fe
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
@@ -16,10 +16,11 @@ module RSpecRcv
16
16
  output = opts[:codec].export_with(output) + "\n"
17
17
 
18
18
  if existing_data
19
- eq = opts[:compare_with].call(existing_data["data"], data, opts)
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(existing_data["data"], data, opts.fetch(:ignore_keys, [])))
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
@@ -1,3 +1,3 @@
1
1
  module RSpecRcv
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
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.1
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-07-26 00:00:00.000000000 Z
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.4.5.1
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.