pact-support 1.2.2 → 1.2.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: c0bcc17c61d1e78e1b6c779b149865a41c02e6dd
4
- data.tar.gz: 652b19baace1a9464ff25f910632601c6a015dd6
3
+ metadata.gz: 7ea7a0b968c225cabc5156de929cc636f0ebeb68
4
+ data.tar.gz: 63253acc40f238e25c1ef447358aa4de91d52ebd
5
5
  SHA512:
6
- metadata.gz: cd274a145b54bcae73c1e35b6dab21c8bb31ccf19aa3f90a00c8234ce0467a908e17531b4a546ce0bbfa244edf6d66c3e0f68aa91fa72d192fb58e8f31afb46a
7
- data.tar.gz: 053b4f6c28a71b7a6c88909f3b85bf7932701ebcddb9654728c3e71163a32ccc25a35f0de4a416110d2925de011b268d84f1cb0cb9dafec7177490166b9a6273
6
+ metadata.gz: 55128238c61ce1a6b33051d0ba9bb7afebf9788e98d4be14baaf7e6c564df512205a0a3ed478f4cc950ba38d81936600e59e3973e9b8c191f7cd93ead5526567
7
+ data.tar.gz: dfcfa77ad1babc601adcb74a17c1cddb099ddd9b686f4dafb25301f2da549820055576b1786377fb2300b0fa6715a0f4d7aa97348cf92770274a050e5cbc12ae
@@ -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 actual
217
- when Pact::IndexNotFound
218
- "Actual array is too short and should have contained #{short_description(expected)} at <path>"
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
- expected_desc = class_name_with_value_in_brackets(expected)
221
- expected_desc.gsub!("(", "(like ")
222
- actual_desc = class_name_with_value_in_brackets(actual)
223
- message = "Expected #{expected_desc} but got #{actual_desc} at <path>"
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
 
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module Support
3
- VERSION = "1.2.2"
3
+ VERSION = "1.2.3"
4
4
  end
5
5
  end
@@ -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.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-27 00:00:00.000000000 Z
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.4.5.2
400
+ rubygems_version: 2.6.12
401
401
  signing_key:
402
402
  specification_version: 4
403
403
  summary: Shared code for Pact gems