pact-support 1.1.2 → 1.1.3

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: 28fb09a1b1f000cce4b9a16ea20d26400ff8fa0a
4
- data.tar.gz: 87433656e306d9ca818b0ea56ecab7c79fe5ec4c
3
+ metadata.gz: 5705c6f8c4fe983c2cb2c5f2be606e3d494f1ac3
4
+ data.tar.gz: 4ba3900546869ecf9f86d783ab3e2d74addd028c
5
5
  SHA512:
6
- metadata.gz: 4f0ced826a85541d5cd4ac8ad6aa5cf014e76f063b44b21282a1efe9730412575f48e1f35d2853ef950dad374671e72c9a11df4e24a3baeda2fcdae81f7151ca
7
- data.tar.gz: ec80f3ad890c6345a6637ac40732fbf8c8d5103d5724eca9bbfca77d36ebb372c51ddf349f2a63a415bffff7a9b7c76be2d9aed87fbd6c05eec87196b226305d
6
+ metadata.gz: e8bf385b08ed2113cb7332df410559b259bbf93306e77ba00f23ec8a22b24556f152e69e88d317066f8c77ce8521ac2e0bc8bc177f662da27371a7afc1e0b52b
7
+ data.tar.gz: 2300ed0ea707978c082fe214694d495cef48a323350e23d27c4a97b932bde6a122f915ee7fc493733f351da7a2042eda83e77860bafffbc949e7cabc840acc32
@@ -2,6 +2,9 @@ Do this to generate your change history
2
2
 
3
3
  git log --pretty=format:' * %h - %s (%an, %ad)'
4
4
 
5
+ ### 1.1.3 (28 July 2017)
6
+ * cd0fc09 - fix(pact serialisation): Use square bracket notation for JSON path keys containing dots when serialising the pact Fixes https://github.com/pact-foundation/pact-support/issues/39 (Beth Skurrie, Fri Jul 28 09:39:15 2017 +1000)
7
+
5
8
  ### 1.1.2 (20 June 2017)
6
9
  * 8c3e53d - Fixing recursive require problems for https://github.com/pact-foundation/pact-support/issues/36 (Beth Skurrie, Tue Jun 20 18:59:24 2017 +1000)
7
10
 
@@ -1,6 +1,7 @@
1
1
  require 'pact/shared/jruby_support'
2
2
  require 'pact/matchers/differ'
3
- require 'pact/matchers/extract_messages'
3
+ require 'pact/matchers/extract_diff_messages'
4
+ require 'pact/configuration'
4
5
 
5
6
  module Pact
6
7
  module Matchers
@@ -38,7 +38,7 @@ module Pact
38
38
 
39
39
  def recurse_hash hash, path, match_type
40
40
  hash.each do | (key, value) |
41
- recurse value, "#{path}.#{key.to_s}", match_type
41
+ recurse value, "#{path}#{next_path_part(key)}", match_type
42
42
  end
43
43
  end
44
44
 
@@ -76,6 +76,14 @@ module Pact
76
76
  rules[path]['match'] = match_type
77
77
  end
78
78
  end
79
+
80
+ def next_path_part key
81
+ if key.to_s.include?('.')
82
+ "[\"#{key}\"]"
83
+ else
84
+ ".#{key}"
85
+ end
86
+ end
79
87
  end
80
88
  end
81
89
  end
@@ -40,7 +40,7 @@ module Pact
40
40
 
41
41
  def recurse_hash hash, path
42
42
  hash.each_with_object({}) do | (k, v), new_hash |
43
- new_path = path + "['#{k.to_s}']"
43
+ new_path = path + "['#{k}']"
44
44
  new_hash[k] = recurse(wrap(v, new_path), new_path)
45
45
  end
46
46
  end
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module Support
3
- VERSION = "1.1.2"
3
+ VERSION = "1.1.3"
4
4
  end
5
5
  end
@@ -1,4 +1,4 @@
1
- require 'pact/matchers/extract_messages'
1
+ require 'pact/matchers/extract_diff_messages'
2
2
 
3
3
  module Pact
4
4
  module Matchers
@@ -196,6 +196,20 @@ module Pact
196
196
  expect(subject).to eq rules
197
197
  end
198
198
  end
199
+
200
+ context "with a key containing a dot" do
201
+ let(:matchable) do
202
+ {
203
+ "key" => {
204
+ "key.with.dots" => Pact::SomethingLike.new("foo")
205
+ }
206
+ }
207
+ end
208
+
209
+ it "uses square brackets notation for the key with dots" do
210
+ expect(subject.keys).to include '$.key["key.with.dots"]'
211
+ end
212
+ end
199
213
  end
200
214
  end
201
215
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Fraser
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2017-06-20 00:00:00.000000000 Z
15
+ date: 2017-07-27 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: randexp
@@ -274,7 +274,7 @@ files:
274
274
  - lib/pact/matchers/difference_indicator.rb
275
275
  - lib/pact/matchers/embedded_diff_formatter.rb
276
276
  - lib/pact/matchers/expected_type.rb
277
- - lib/pact/matchers/extract_messages.rb
277
+ - lib/pact/matchers/extract_diff_messages.rb
278
278
  - lib/pact/matchers/index_not_found.rb
279
279
  - lib/pact/matchers/list_diff_formatter.rb
280
280
  - lib/pact/matchers/matchers.rb
@@ -325,7 +325,7 @@ files:
325
325
  - spec/lib/pact/matchers/differ_spec.rb
326
326
  - spec/lib/pact/matchers/difference_spec.rb
327
327
  - spec/lib/pact/matchers/embedded_diff_formatter_spec.rb
328
- - spec/lib/pact/matchers/extract_messages_spec.rb
328
+ - spec/lib/pact/matchers/extract_diff_messages_spec.rb
329
329
  - spec/lib/pact/matchers/index_not_found_spec.rb
330
330
  - spec/lib/pact/matchers/list_diff_formatter_spec.rb
331
331
  - spec/lib/pact/matchers/matchers_array_like_spec.rb
@@ -396,7 +396,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
396
396
  version: '0'
397
397
  requirements: []
398
398
  rubyforge_project:
399
- rubygems_version: 2.4.5
399
+ rubygems_version: 2.6.12
400
400
  signing_key:
401
401
  specification_version: 4
402
402
  summary: Shared code for Pact gems
@@ -419,7 +419,7 @@ test_files:
419
419
  - spec/lib/pact/matchers/differ_spec.rb
420
420
  - spec/lib/pact/matchers/difference_spec.rb
421
421
  - spec/lib/pact/matchers/embedded_diff_formatter_spec.rb
422
- - spec/lib/pact/matchers/extract_messages_spec.rb
422
+ - spec/lib/pact/matchers/extract_diff_messages_spec.rb
423
423
  - spec/lib/pact/matchers/index_not_found_spec.rb
424
424
  - spec/lib/pact/matchers/list_diff_formatter_spec.rb
425
425
  - spec/lib/pact/matchers/matchers_array_like_spec.rb