pact-support 1.2.2 → 1.2.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ea7a0b968c225cabc5156de929cc636f0ebeb68
|
4
|
+
data.tar.gz: 63253acc40f238e25c1ef447358aa4de91d52ebd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55128238c61ce1a6b33051d0ba9bb7afebf9788e98d4be14baaf7e6c564df512205a0a3ed478f4cc950ba38d81936600e59e3973e9b8c191f7cd93ead5526567
|
7
|
+
data.tar.gz: dfcfa77ad1babc601adcb74a17c1cddb099ddd9b686f4dafb25301f2da549820055576b1786377fb2300b0fa6715a0f4d7aa97348cf92770274a050e5cbc12ae
|
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.2.3 (2017-10-30)
|
6
|
+
* 68be738 - fix: diff message when actual 'array like' is too long (Beth Skurrie, Mon Oct 30 09:28:20 2017 +1100)
|
7
|
+
|
5
8
|
### 1.2.2 (2017-10-27)
|
6
9
|
* 97ba7d9 - fix: correctly handle array like when key not found (Beth Skurrie, Fri Oct 27 12:50:50 2017 +1100)
|
7
10
|
|
@@ -213,14 +213,19 @@ module Pact
|
|
213
213
|
end
|
214
214
|
|
215
215
|
def type_difference_message expected, actual
|
216
|
-
case
|
217
|
-
when Pact::
|
218
|
-
"Actual array is too
|
216
|
+
case expected
|
217
|
+
when Pact::UnexpectedIndex
|
218
|
+
"Actual array is too long and should not contain #{short_description(actual)} at <path>"
|
219
219
|
else
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
220
|
+
case actual
|
221
|
+
when Pact::IndexNotFound
|
222
|
+
"Actual array is too short and should have contained #{short_description(expected)} at <path>"
|
223
|
+
else
|
224
|
+
expected_desc = class_name_with_value_in_brackets(expected)
|
225
|
+
expected_desc.gsub!("(", "(like ")
|
226
|
+
actual_desc = class_name_with_value_in_brackets(actual)
|
227
|
+
message = "Expected #{expected_desc} but got #{actual_desc} at <path>"
|
228
|
+
end
|
224
229
|
end
|
225
230
|
end
|
226
231
|
|
data/lib/pact/support/version.rb
CHANGED
@@ -129,6 +129,18 @@ module Pact::Matchers
|
|
129
129
|
end
|
130
130
|
end
|
131
131
|
end
|
132
|
+
|
133
|
+
context "with an ArrayLike" do
|
134
|
+
context "with an extra item that is an Integer" do
|
135
|
+
let(:expected) { {thing: Pact.like([1])} }
|
136
|
+
let(:actual) { {thing: [1, 2]} }
|
137
|
+
let(:difference) { diff(expected, actual) }
|
138
|
+
|
139
|
+
it "returns a message" do
|
140
|
+
expect(difference[:thing][1].message).to eq "Actual array is too long and should not contain 2 at <path>"
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
132
144
|
end
|
133
145
|
end
|
134
146
|
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.2.
|
4
|
+
version: 1.2.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-10-
|
15
|
+
date: 2017-10-29 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: randexp
|
@@ -397,7 +397,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
397
397
|
version: '0'
|
398
398
|
requirements: []
|
399
399
|
rubyforge_project:
|
400
|
-
rubygems_version: 2.
|
400
|
+
rubygems_version: 2.6.12
|
401
401
|
signing_key:
|
402
402
|
specification_version: 4
|
403
403
|
summary: Shared code for Pact gems
|