rspec-expectations 3.2.0 → 3.2.1

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: a17c12beef7f8a1e2fa131987dbd3f487b9df046
4
- data.tar.gz: 0854aa31f5d41a21d11f7cb33feccb38f19f76f6
3
+ metadata.gz: 3aa831b7183b5d522f5e67b19053832a7adeec29
4
+ data.tar.gz: fef8e60148530b9df3545e113341083c426baa56
5
5
  SHA512:
6
- metadata.gz: 7952e648e91578f32c772b5f1d4679e06bbec42483a84b15c9e96828f4246a43f7e96a63d4bb7a50c0f809c6aa03a6df3a7439cc0815130518165b4e18cd2193
7
- data.tar.gz: 50ca10401b8ead80b338c126b132381fd70df460c52a6d7df426f19020ac2fc5e423d7636456855099122be84df1e396a0a024e27849f8ac959becf7e82c29ba
6
+ metadata.gz: e51ebb3d7564f575eee701467eda6e003fade12c2644b38b6b8eba5d2820bccfe60ab22d8ae410e76bd0e5c18dfdbd94298108699f5d4d6a12ee61fb65f03db1
7
+ data.tar.gz: 75f4ea4fd9cf63a31967aa3cceb6071de46dd57c3326fe8cd35d47710c741d45d36ba2b77593236d2f614a0b1e921c6a21e08b60c41cd23b7431e77835d68248
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,13 @@
1
+ ### 3.2.1 / 2015-04-06
2
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.2.0...v3.2.1)
3
+
4
+ Bug Fixes:
5
+
6
+ * Prevent `Range`s from being enumerated when generating matcher
7
+ descriptions. (Jon Rowe, #755)
8
+ * Ensure exception messages are compared as strings in the `raise_error`
9
+ matcher. (Jon Rowe, #755)
10
+
1
11
  ### 3.2.0 / 2015-02-03
2
12
  [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.1.2...v3.2.0)
3
13
 
@@ -2,7 +2,7 @@ module RSpec
2
2
  module Expectations
3
3
  # @private
4
4
  module Version
5
- STRING = '3.2.0'
5
+ STRING = '3.2.1'
6
6
  end
7
7
  end
8
8
  end
@@ -50,7 +50,7 @@ module RSpec
50
50
  def convert_actual_to_an_array
51
51
  if actual.respond_to?(:to_ary)
52
52
  @actual = actual.to_ary
53
- elsif enumerable?(actual) && actual.respond_to?(:to_a)
53
+ elsif should_enumerate?(actual) && actual.respond_to?(:to_a)
54
54
  @actual = actual.to_a
55
55
  else
56
56
  return false
@@ -115,7 +115,7 @@ module RSpec
115
115
 
116
116
  def verify_message
117
117
  return true if @expected_message.nil?
118
- values_match?(@expected_message, @actual_error.message)
118
+ values_match?(@expected_message, @actual_error.message.to_s)
119
119
  end
120
120
 
121
121
  def prevent_invalid_expectations
@@ -103,7 +103,7 @@ module RSpec
103
103
  Hash[surface_descriptions_in(item.to_a)]
104
104
  elsif Struct === item
105
105
  item.inspect
106
- elsif enumerable?(item)
106
+ elsif should_enumerate?(item)
107
107
  begin
108
108
  item.map { |subitem| surface_descriptions_in(subitem) }
109
109
  rescue IOError # STDOUT is enumerable but `map` raises an error
@@ -137,7 +137,7 @@ module RSpec
137
137
  Hash[with_matchers_cloned(object.to_a)]
138
138
  elsif Struct === object
139
139
  object
140
- elsif enumerable?(object)
140
+ elsif should_enumerate?(object)
141
141
  begin
142
142
  object.map { |subobject| with_matchers_cloned(subobject) }
143
143
  rescue IOError # STDOUT is enumerable but `map` raises an error
@@ -155,17 +155,17 @@ module RSpec
155
155
  # a single 1-character string, which is an enumerable, etc.
156
156
  #
157
157
  # @api private
158
- def enumerable?(item)
158
+ def should_enumerate?(item)
159
159
  return false if String === item
160
- Enumerable === item
160
+ Enumerable === item && !(Range === item)
161
161
  end
162
162
  else
163
163
  # @api private
164
- def enumerable?(item)
165
- Enumerable === item
164
+ def should_enumerate?(item)
165
+ Enumerable === item && !(Range === item)
166
166
  end
167
167
  end
168
- module_function :surface_descriptions_in, :enumerable?
168
+ module_function :surface_descriptions_in, :should_enumerate?
169
169
 
170
170
  # Wraps an item in order to surface its `description` via `inspect`.
171
171
  # @api private
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.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Baker
@@ -45,7 +45,7 @@ cert_chain:
45
45
  ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
46
46
  F3MdtaDehhjC
47
47
  -----END CERTIFICATE-----
48
- date: 2015-02-03 00:00:00.000000000 Z
48
+ date: 2015-04-06 00:00:00.000000000 Z
49
49
  dependencies:
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: rspec-support
@@ -218,6 +218,6 @@ rubyforge_project: rspec
218
218
  rubygems_version: 2.2.2
219
219
  signing_key:
220
220
  specification_version: 4
221
- summary: rspec-expectations-3.2.0
221
+ summary: rspec-expectations-3.2.1
222
222
  test_files: []
223
223
  has_rdoc:
metadata.gz.sig CHANGED
Binary file