rspec-expectations 3.2.0 → 3.2.1
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Changelog.md +10 -0
- data/lib/rspec/expectations/version.rb +1 -1
- data/lib/rspec/matchers/built_in/contain_exactly.rb +1 -1
- data/lib/rspec/matchers/built_in/raise_error.rb +1 -1
- data/lib/rspec/matchers/composable.rb +7 -7
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3aa831b7183b5d522f5e67b19053832a7adeec29
|
4
|
+
data.tar.gz: fef8e60148530b9df3545e113341083c426baa56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e51ebb3d7564f575eee701467eda6e003fade12c2644b38b6b8eba5d2820bccfe60ab22d8ae410e76bd0e5c18dfdbd94298108699f5d4d6a12ee61fb65f03db1
|
7
|
+
data.tar.gz: 75f4ea4fd9cf63a31967aa3cceb6071de46dd57c3326fe8cd35d47710c741d45d36ba2b77593236d2f614a0b1e921c6a21e08b60c41cd23b7431e77835d68248
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -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
|
|
@@ -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
|
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
|
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
|
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
|
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
|
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, :
|
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.
|
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-
|
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.
|
221
|
+
summary: rspec-expectations-3.2.1
|
222
222
|
test_files: []
|
223
223
|
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|