pact-support 1.1.5 → 1.1.6

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: 8ea2875d5e2dc8777d847b774ec40a0d4afd539e
4
- data.tar.gz: 425177cb326444b96ed9d24081e6d8f02daefec4
3
+ metadata.gz: 50cf90801b288d0d6f9a020193c22a58ad31a1f1
4
+ data.tar.gz: 2bf0663efdb8fd0df0628923f56c4aa6d13a4276
5
5
  SHA512:
6
- metadata.gz: ce82242279a886e133d667a06e2202a81e009e8a4bd3c5c2f2a904f849421af09ec7a1159be83370806b247e7fda0404efe0568121c294cd74dfb068e9137085
7
- data.tar.gz: 0efae033f755ab785ec05e91a3acf8e9b732991374115ea879bebf4f75ea27bec34655914ec2756d0ebe6fd68a2fdedc5affc9acba1a656a916ca91e62d638c1
6
+ metadata.gz: 0a22eaf84f8c557ba9d3c0465bd89369e0149742117f1746e5f847aae9e19db2ffb04434e735fb49c1e8c4177303de34e8580a2c45b60b243b1bf461373365aa
7
+ data.tar.gz: e074377405d4fd0dba18327e4c04f4d2b5d1340e1b669042ec7747bf9acbb3943fe4d013c923671463d08f49007666a3126cfa790e08dbcb37d5a66cc9a57670
data/CHANGELOG.md CHANGED
@@ -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.6 (2017-08-25)
6
+ * be9ef39 - fix(matching): use single quotes instead of double to escape keys with dots (Beth Skurrie, Fri Aug 25 09:41:14 2017 +1000)
7
+
5
8
  ### 1.1.5 (1 Aug 2017)
6
9
  * 81bc967 - fix(match type rules): Allow match: 'type' to be specified on the parent element of the array. Closes: #35, https://github.com/pact-foundation/pact-provider-verifier/issues/8 (Beth Skurrie, Tue Aug 1 10:33:02 2017 +1000)
7
10
 
data/RELEASING.md CHANGED
@@ -8,7 +8,7 @@
8
8
  3. Add files to git
9
9
 
10
10
  $ git add CHANGELOG.md lib/pact/support/version.rb
11
- $ git commit -m "Releasing version $(ruby -r ./lib/pact/support/version.rb -e "puts Pact::Support::VERSION")"
11
+ $ git commit -m "chore(release): version $(ruby -r ./lib/pact/support/version.rb -e "puts Pact::Support::VERSION")"
12
12
 
13
13
  3. Release:
14
14
 
@@ -77,9 +77,11 @@ module Pact
77
77
  end
78
78
  end
79
79
 
80
+ # Beth: there's a potential bug if the key contains a dot and a single quote.
81
+ # Not sure what to do then.
80
82
  def next_path_part key
81
83
  if key.to_s.include?('.')
82
- "[\"#{key}\"]"
84
+ "['#{key}']"
83
85
  else
84
86
  ".#{key}"
85
87
  end
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module Support
3
- VERSION = "1.1.5"
3
+ VERSION = "1.1.6"
4
4
  end
5
5
  end
@@ -207,7 +207,7 @@ module Pact
207
207
  end
208
208
 
209
209
  it "uses square brackets notation for the key with dots" do
210
- expect(subject.keys).to include '$.key["key.with.dots"]'
210
+ expect(subject.keys).to include "$.key['key.with.dots']"
211
211
  end
212
212
  end
213
213
  end
@@ -307,6 +307,42 @@ module Pact
307
307
  expect(subject['name']).to be_instance_of(Pact::SomethingLike)
308
308
  end
309
309
  end
310
+
311
+ describe "with a dot in the path" do
312
+ let(:expected) do
313
+ {
314
+ "first.name" => "Mary"
315
+ }
316
+ end
317
+
318
+ let(:matching_rules) do
319
+ {
320
+ "$.body['first.name']" => { "match" => "type" }
321
+ }
322
+ end
323
+
324
+ it "applies the rule" do
325
+ expect(subject['first.name']).to be_instance_of(Pact::SomethingLike)
326
+ end
327
+ end
328
+
329
+ describe "with an @ in the path" do
330
+ let(:expected) do
331
+ {
332
+ "@name" => "Mary"
333
+ }
334
+ end
335
+
336
+ let(:matching_rules) do
337
+ {
338
+ "$.body['@name']" => { "match" => "type" }
339
+ }
340
+ end
341
+
342
+ it "applies the rule" do
343
+ expect(subject['@name']).to be_instance_of(Pact::SomethingLike)
344
+ end
345
+ end
310
346
  end
311
347
  end
312
348
  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.5
4
+ version: 1.1.6
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-08-01 00:00:00.000000000 Z
15
+ date: 2017-08-24 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: randexp
@@ -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.6.12
399
+ rubygems_version: 2.4.5.2
400
400
  signing_key:
401
401
  specification_version: 4
402
402
  summary: Shared code for Pact gems