rspec-expectations 3.0.1 → 3.0.2

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: d379423e0b4e64ab171259aadfc7c135fc10e1a5
4
- data.tar.gz: 801537a8f0cb606eaa4b814f32eecd39e09ed431
3
+ metadata.gz: ab0ab80e39aa5fde21f8720bbc62094627a8657f
4
+ data.tar.gz: 74ee61900c9df6b0f21746fe417b06067a65e6f6
5
5
  SHA512:
6
- metadata.gz: ca469b494c808f9f76aff95b1818459b1da61577825f6162e6fa4b5b33b4f9b8b728890da22388c177b2d05e04ca4b9378d528b1dfb02465a5679fef24084f8f
7
- data.tar.gz: 9a97e088ce0fa1761ae2693d8cd61b42dcc3184f4137a4f578871d4df61c3c72f293aecfafd5e85eaf0e7d7179f6f18e7f46fa067626c6a0dd9043530b9cc857
6
+ metadata.gz: 0869ab245a3b41c76cbdeaeb90dc480c29c0efeeb991a917b71d5a8773aec1e481098b308ea1f3eecd417b4ae799bc064e0e8a0d1346fa99b79f35ee46b118b9
7
+ data.tar.gz: b98ebf674da13b00db2cd615322dffc97454a720ce585b9cd2311c951e1931b9babfd8e48fa8126932507c94838634aa5eb88a9e07ce4219b9a0b76ffc9771e4
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,16 @@
1
+ ### 3.0.2 / 2014-06-19
2
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.0.1...v3.0.2)
3
+
4
+ Bug Fixes:
5
+
6
+ * Fix regression in `contain_exactly` (AKA `match_array`) that caused it
7
+ to wrongly pass when the expected array was empty. (Myron Marston, #581)
8
+ * Provide a better error message when you use the `change(obj, :msg)`
9
+ form of the change matcher but forget the message argument. (Alex
10
+ Sunderland, #585)
11
+ * Make the `contain_exactly` matcher work with arrays that contain hashes in
12
+ arbitrary ordering. (Sam Phippen, #578)
13
+
1
14
  ### 3.0.1 / 2014-06-12
2
15
  [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.0.0...v3.0.1)
3
16
 
@@ -169,7 +182,7 @@ Deprecations:
169
182
  a deprecation warning. (Myron Marston)
170
183
 
171
184
  ### 3.0.0.beta1 / 2013-11-07
172
- [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.0...v3.0.0.beta1)
185
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.1...v3.0.0.beta1)
173
186
 
174
187
  Breaking Changes for 3.0.0:
175
188
 
@@ -217,6 +230,14 @@ Deprecations:
217
230
  It will continue to work but will emit a deprecation warning in RSpec 3 if
218
231
  you do not explicitly enable it. (Sam Phippen)
219
232
 
233
+ ### 2.99.1 / 2014-06-19
234
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.0...v2.99.1)
235
+
236
+ Bug Fixes:
237
+
238
+ * Fix typo in custom matcher `expected` deprecation warning -- it's
239
+ `expected_as_array`, not `expected_array`. (Frederick Cheung, #562)
240
+
220
241
  ### 2.99.0 / 2014-06-01
221
242
  [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.0.rc1...v2.99.0)
222
243
 
@@ -2,7 +2,7 @@ module RSpec
2
2
  module Expectations
3
3
  # @private
4
4
  module Version
5
- STRING = '3.0.1'
5
+ STRING = '3.0.2'
6
6
  end
7
7
  end
8
8
  end
@@ -298,6 +298,14 @@ module RSpec
298
298
  attr_reader :message, :actual_before, :actual_after
299
299
 
300
300
  def initialize(receiver=nil, message=nil, &block)
301
+ if receiver && !message
302
+ raise(
303
+ ArgumentError,
304
+ "`change` requires either an object and message " \
305
+ "(`change(obj, :msg)`) or a block (`change { }`). " \
306
+ "You passed an object but no message."
307
+ )
308
+ end
301
309
  @message = message ? "##{message}" : "result"
302
310
  @value_proc = block || lambda { receiver.__send__(message) }
303
311
  end
@@ -79,20 +79,12 @@ module RSpec
79
79
 
80
80
  def pairings_maximizer
81
81
  @pairings_maximizer ||= begin
82
- expected_matches = {}
83
- actual_matches = {}
82
+ expected_matches = Hash[Array.new(expected.size) { |i| [i, []] }]
83
+ actual_matches = Hash[Array.new(actual.size) { |i| [i, []] }]
84
84
 
85
85
  expected.each_with_index do |e, ei|
86
- expected_matches[ei] ||= []
87
-
88
86
  actual.each_with_index do |a, ai|
89
- actual_matches[ai] ||= []
90
-
91
- # Normally we'd call `values_match?(e, a)` here but that contains
92
- # some extra checks we don't need (e.g. to support nested data
93
- # structures), and given that it's called N*M times here, it helps
94
- # perf significantly to implement the matching bit ourselves.
95
- next unless e === a || a == e
87
+ next unless values_match?(e, a)
96
88
 
97
89
  expected_matches[ei] << ai
98
90
  actual_matches[ai] << ei
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-expectations
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Baker
@@ -33,7 +33,7 @@ cert_chain:
33
33
  1yHC1AcSYpvi2dAbOiHT5iQF+krm4wse8KctXgTNnjMsHEoGKulJS2/sZl90jcCz
34
34
  muA=
35
35
  -----END CERTIFICATE-----
36
- date: 2014-06-12 00:00:00.000000000 Z
36
+ date: 2014-06-20 00:00:00.000000000 Z
37
37
  dependencies:
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: rspec-support
@@ -203,6 +203,6 @@ rubyforge_project: rspec
203
203
  rubygems_version: 2.2.2
204
204
  signing_key:
205
205
  specification_version: 4
206
- summary: rspec-expectations-3.0.1
206
+ summary: rspec-expectations-3.0.2
207
207
  test_files: []
208
208
  has_rdoc:
metadata.gz.sig CHANGED
Binary file