pact-support 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ca7c80e800c3532f03fb388b4565c9a229f947c
4
- data.tar.gz: 817f38e17854ef3d3a63965fc3ff99160d0fa372
3
+ metadata.gz: c0bcc17c61d1e78e1b6c779b149865a41c02e6dd
4
+ data.tar.gz: 652b19baace1a9464ff25f910632601c6a015dd6
5
5
  SHA512:
6
- metadata.gz: a67527868f5147796f40bd2d8beaf220e1310f9921df45fec730098cde73ed37a1c2dae87971df5342203f16617770632f7dac3d08cbcc325398c88d27189bc3
7
- data.tar.gz: 29ed75975627e19dab65f5f0e8ed59260fa639a399fa9e0fa31532ed0d237d240b46bf1639ded5376cf29a9b4b5a30f2c0697decf6f8124a2ea7514c18fbb308
6
+ metadata.gz: cd274a145b54bcae73c1e35b6dab21c8bb31ccf19aa3f90a00c8234ce0467a908e17531b4a546ce0bbfa244edf6d66c3e0f68aa91fa72d192fb58e8f31afb46a
7
+ data.tar.gz: 053b4f6c28a71b7a6c88909f3b85bf7932701ebcddb9654728c3e71163a32ccc25a35f0de4a416110d2925de011b268d84f1cb0cb9dafec7177490166b9a6273
@@ -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.2.2 (2017-10-27)
6
+ * 97ba7d9 - fix: correctly handle array like when key not found (Beth Skurrie, Fri Oct 27 12:50:50 2017 +1100)
7
+
5
8
  ### 1.2.1 (2017-10-03)
6
9
  * c3b3f22 - fix: ignore invalid params in response constructor hash (Beth Skurrie, Tue Oct 3 15:40:22 2017 +1100)
7
10
 
@@ -115,7 +115,7 @@ module Pact
115
115
  expected_array = expected_size.times.collect{ Pact::Term.unpack_regexps(array_like.contents) }
116
116
  actual_array_diff expected_array, actual, options.merge(:type => true)
117
117
  else
118
- Difference.new array_like.generate, actual, type_difference_message(expected, actual)
118
+ Difference.new array_like.generate, actual, type_difference_message(array_like.generate, actual)
119
119
  end
120
120
  end
121
121
 
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module Support
3
- VERSION = "1.2.1"
3
+ VERSION = "1.2.2"
4
4
  end
5
5
  end
@@ -3,8 +3,6 @@ require 'pact/matchers'
3
3
  module Pact
4
4
  describe Matchers do
5
5
 
6
- include Pact::Matchers
7
-
8
6
  let(:min) { 1 }
9
7
  let(:expected) do
10
8
  {
@@ -12,7 +10,7 @@ module Pact
12
10
  }
13
11
  end
14
12
 
15
- let(:difference) { diff(expected, actual) }
13
+ let(:difference) { Pact::Matchers.diff(expected, actual) }
16
14
 
17
15
  context "when each element in the array matches by type" do
18
16
  let(:actual) do
@@ -96,6 +94,23 @@ module Pact
96
94
  end
97
95
  end
98
96
 
97
+ context "when an ArrayLike is expected but a hash is found" do
98
+ let(:actual) do
99
+ {
100
+
101
+ }
102
+ end
103
+ let(:expected_difference) do
104
+ {
105
+ animals: Matchers::Difference.new([{name: 'Fred'}], Pact::KeyNotFound.new)
106
+ }
107
+ end
108
+
109
+ it "returns a diff" do
110
+ expect(difference).to eq expected_difference
111
+ end
112
+ end
113
+
99
114
  context "when an ArrayLike is expected but the actual does not have enough elements in it" do
100
115
  let(:min) { 2 }
101
116
  let(:actual) do
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.2.1
4
+ version: 1.2.2
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-10-03 00:00:00.000000000 Z
15
+ date: 2017-10-27 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: randexp