rspec-expectations 3.8.2 → 3.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Changelog.md +16 -0
- data/lib/rspec/expectations/version.rb +1 -1
- data/lib/rspec/matchers/built_in/all.rb +1 -0
- data/lib/rspec/matchers/built_in/be_instance_of.rb +11 -1
- data/lib/rspec/matchers/built_in/be_kind_of.rb +13 -1
- data/lib/rspec/matchers/built_in/change.rb +4 -2
- metadata +10 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35a04d20c51a45fbf58b5bf8ccdcd5d86f4e2c106aee9906afd3d3bb8e417b62
|
4
|
+
data.tar.gz: 3c8218a13a68549fc5df77a74584d87fa71d954058f61bd1710bc8aeeddc2bfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f196ef51fc2f48e4d5dd5a685b0847f797c5ef8e0de9b294873dbcadbcb2f2fb1574ef1662052f2e127083195a149ae604a95f5725cd879f912d586be2b37d8f
|
7
|
+
data.tar.gz: 93a6786e1205e5baddad562b0162de3452b9659a73f7a566e40a1c7c7b93d60637b64db27a366056b93a1a6187436feddd3a0eb80507ed69a37b8a6747bc23e2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
### Development
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.8.3...3-8-maintenance)
|
3
|
+
|
4
|
+
### 3.8.3 / 2019-04-20
|
5
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.8.2...v3.8.3)
|
6
|
+
|
7
|
+
Bug Fixes:
|
8
|
+
|
9
|
+
* Prevent composed `all` matchers from leaking into their siblings leading to duplicate
|
10
|
+
failures. (Jamie English, #1086)
|
11
|
+
* Prevent objects which change their hash on comparison from failing change checks.
|
12
|
+
(Phil Pirozhkov, #1110)
|
13
|
+
* Issue an `ArgumentError` rather than a `NoMethodError` when `be_an_instance_of` and
|
14
|
+
`be_kind_of` matchers encounter objects not supporting those methods.
|
15
|
+
(Taichi Ishitani, #1107)
|
16
|
+
|
1
17
|
### 3.8.2 / 2018-10-09
|
2
18
|
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.8.1...v3.8.2)
|
3
19
|
|
@@ -14,7 +14,17 @@ module RSpec
|
|
14
14
|
private
|
15
15
|
|
16
16
|
def match(expected, actual)
|
17
|
-
actual
|
17
|
+
if actual_object_respond_to?(actual, :instance_of?)
|
18
|
+
actual.instance_of?(expected)
|
19
|
+
else
|
20
|
+
raise ::ArgumentError, "The #{matcher_name} matcher requires that " \
|
21
|
+
"the actual object responds to #instance_of? method " \
|
22
|
+
"but it does not respond to the method."
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def actual_object_respond_to?(actual, method)
|
27
|
+
::Kernel.instance_method(:respond_to?).bind(actual).call(method)
|
18
28
|
end
|
19
29
|
end
|
20
30
|
end
|
@@ -8,7 +8,19 @@ module RSpec
|
|
8
8
|
private
|
9
9
|
|
10
10
|
def match(expected, actual)
|
11
|
-
actual
|
11
|
+
if actual_object_respond_to?(actual, :kind_of?)
|
12
|
+
actual.kind_of?(expected)
|
13
|
+
elsif actual_object_respond_to?(actual, :is_a?)
|
14
|
+
actual.is_a?(expected)
|
15
|
+
else
|
16
|
+
raise ::ArgumentError, "The #{matcher_name} matcher requires that " \
|
17
|
+
"the actual object responds to either #kind_of? or #is_a? methods "\
|
18
|
+
"but it responds to neigher of two methods."
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def actual_object_respond_to?(actual, method)
|
23
|
+
::Kernel.instance_method(:respond_to?).bind(actual).call(method)
|
12
24
|
end
|
13
25
|
end
|
14
26
|
end
|
@@ -373,6 +373,7 @@ module RSpec
|
|
373
373
|
event_proc.call
|
374
374
|
|
375
375
|
@actual_after = evaluate_value_proc
|
376
|
+
@actual_hash = @actual_after.hash
|
376
377
|
true
|
377
378
|
end
|
378
379
|
|
@@ -387,8 +388,9 @@ module RSpec
|
|
387
388
|
#
|
388
389
|
# Note that it is not sufficient to only check the hashes; it is
|
389
390
|
# possible for two values to be unequal (and of different classes)
|
390
|
-
# but to return the same hash value.
|
391
|
-
|
391
|
+
# but to return the same hash value. Also, some objects may change
|
392
|
+
# their hash after being compared with `==`/`!=`.
|
393
|
+
@actual_before != @actual_after || @before_hash != @actual_hash
|
392
394
|
end
|
393
395
|
|
394
396
|
def actual_delta
|
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.8.
|
4
|
+
version: 3.8.3
|
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:
|
48
|
+
date: 2019-04-21 00:00:00.000000000 Z
|
49
49
|
dependencies:
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: rspec-support
|
@@ -200,7 +200,12 @@ files:
|
|
200
200
|
homepage: https://github.com/rspec/rspec-expectations
|
201
201
|
licenses:
|
202
202
|
- MIT
|
203
|
-
metadata:
|
203
|
+
metadata:
|
204
|
+
bug_tracker_uri: https://github.com/rspec/rspec-expectations/issues
|
205
|
+
changelog_uri: https://github.com/rspec/rspec-expectations/blob/v3.8.3/Changelog.md
|
206
|
+
documentation_uri: https://rspec.info/documentation/
|
207
|
+
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
208
|
+
source_code_uri: https://github.com/rspec/rspec-expectations
|
204
209
|
post_install_message:
|
205
210
|
rdoc_options:
|
206
211
|
- "--charset=UTF-8"
|
@@ -217,9 +222,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
222
|
- !ruby/object:Gem::Version
|
218
223
|
version: '0'
|
219
224
|
requirements: []
|
220
|
-
|
221
|
-
rubygems_version: 2.7.6
|
225
|
+
rubygems_version: 3.0.3
|
222
226
|
signing_key:
|
223
227
|
specification_version: 4
|
224
|
-
summary: rspec-expectations-3.8.
|
228
|
+
summary: rspec-expectations-3.8.3
|
225
229
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|