rspec-expectations 3.9.3 → 3.9.4
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 +8 -0
- data/lib/rspec/expectations/version.rb +1 -1
- data/lib/rspec/matchers.rb +9 -23
- data/lib/rspec/matchers/built_in/be.rb +8 -31
- data/lib/rspec/matchers/built_in/has.rb +5 -24
- metadata +4 -4
- 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: 0a7b90c1caeec07d53054eb0536482494c2584e6d7cb0fc9cfd3493ebc6b27a7
|
4
|
+
data.tar.gz: 2eed511b0562ee702eb71bda98058c61d9ddda6c7b0337adde7acd72ddfb81df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d0ea4666034e2901450f23fe706d1258f0b2c37ac7edd823477e31eae7c6d56e597a0b728cea0fe5f12ab80ee43ac4ed1a5c203ef34f66d180b40713adedf81
|
7
|
+
data.tar.gz: 3b42d8706be59eb0dd511497941c34cebaff7476394f3f1ca80326d26c362bf3b37cca520ae0c6002a8efe167ee3fe7707e41e53072ac000c8c2a89f960fa6c0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
### 3.9.4 / 2020-10-29
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.9.3...v3.9.4)
|
3
|
+
|
4
|
+
Bug Fixes:
|
5
|
+
|
6
|
+
* Fix regression with `be_` and `have_` matchers and arguments implementing `to_hash`
|
7
|
+
were they would act like keywords and be cast to a hash. (Jon Rowe, #1222)
|
8
|
+
|
1
9
|
### 3.9.3 / 2020-10-23
|
2
10
|
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.9.2...v3.9.3)
|
3
11
|
|
data/lib/rspec/matchers.rb
CHANGED
@@ -953,31 +953,17 @@ module RSpec
|
|
953
953
|
HAS_REGEX = /^(?:have_)(.*)/
|
954
954
|
DYNAMIC_MATCHER_REGEX = Regexp.union(BE_PREDICATE_REGEX, HAS_REGEX)
|
955
955
|
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
else
|
965
|
-
super
|
966
|
-
end
|
967
|
-
end
|
968
|
-
CODE
|
969
|
-
else
|
970
|
-
def method_missing(method, *args, &block)
|
971
|
-
case method.to_s
|
972
|
-
when BE_PREDICATE_REGEX
|
973
|
-
BuiltIn::BePredicate.new(method, *args, &block)
|
974
|
-
when HAS_REGEX
|
975
|
-
BuiltIn::Has.new(method, *args, &block)
|
976
|
-
else
|
977
|
-
super
|
978
|
-
end
|
956
|
+
def method_missing(method, *args, &block)
|
957
|
+
case method.to_s
|
958
|
+
when BE_PREDICATE_REGEX
|
959
|
+
BuiltIn::BePredicate.new(method, *args, &block)
|
960
|
+
when HAS_REGEX
|
961
|
+
BuiltIn::Has.new(method, *args, &block)
|
962
|
+
else
|
963
|
+
super
|
979
964
|
end
|
980
965
|
end
|
966
|
+
ruby2_keywords :method_missing if respond_to?(:ruby2_keywords, true)
|
981
967
|
|
982
968
|
if RUBY_VERSION.to_f >= 1.9
|
983
969
|
def respond_to_missing?(method, *)
|
@@ -193,22 +193,12 @@ module RSpec
|
|
193
193
|
class BePredicate < BaseMatcher
|
194
194
|
include BeHelpers
|
195
195
|
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
@args = args
|
201
|
-
@kwargs = kwargs
|
202
|
-
@block = block
|
203
|
-
end
|
204
|
-
CODE
|
205
|
-
else
|
206
|
-
def initialize(*args, &block)
|
207
|
-
@expected = parse_expected(args.shift)
|
208
|
-
@args = args
|
209
|
-
@block = block
|
210
|
-
end
|
196
|
+
def initialize(*args, &block)
|
197
|
+
@expected = parse_expected(args.shift)
|
198
|
+
@args = args
|
199
|
+
@block = block
|
211
200
|
end
|
201
|
+
ruby2_keywords :initialize if respond_to?(:ruby2_keywords, true)
|
212
202
|
|
213
203
|
def matches?(actual, &block)
|
214
204
|
@actual = actual
|
@@ -259,22 +249,9 @@ module RSpec
|
|
259
249
|
end
|
260
250
|
end
|
261
251
|
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
method_name = actual.respond_to?(predicate) ? predicate : present_tense_predicate
|
266
|
-
if @kwargs.empty?
|
267
|
-
@predicate_matches = actual.__send__(method_name, *@args, &@block)
|
268
|
-
else
|
269
|
-
@predicate_matches = actual.__send__(method_name, *@args, **@kwargs, &@block)
|
270
|
-
end
|
271
|
-
end
|
272
|
-
CODE
|
273
|
-
else
|
274
|
-
def predicate_matches?
|
275
|
-
method_name = actual.respond_to?(predicate) ? predicate : present_tense_predicate
|
276
|
-
@predicate_matches = actual.__send__(method_name, *@args, &@block)
|
277
|
-
end
|
252
|
+
def predicate_matches?
|
253
|
+
method_name = actual.respond_to?(predicate) ? predicate : present_tense_predicate
|
254
|
+
@predicate_matches = actual.__send__(method_name, *@args, &@block)
|
278
255
|
end
|
279
256
|
|
280
257
|
def predicate
|
@@ -5,17 +5,10 @@ module RSpec
|
|
5
5
|
# Provides the implementation for `has_<predicate>`.
|
6
6
|
# Not intended to be instantiated directly.
|
7
7
|
class Has < BaseMatcher
|
8
|
-
|
9
|
-
|
10
|
-
def initialize(method_name, *args, **kwargs, &block)
|
11
|
-
@method_name, @args, @kwargs, @block = method_name, args, kwargs, block
|
12
|
-
end
|
13
|
-
CODE
|
14
|
-
else
|
15
|
-
def initialize(method_name, *args, &block)
|
16
|
-
@method_name, @args, @block = method_name, args, block
|
17
|
-
end
|
8
|
+
def initialize(method_name, *args, &block)
|
9
|
+
@method_name, @args, @block = method_name, args, block
|
18
10
|
end
|
11
|
+
ruby2_keywords :initialize if respond_to?(:ruby2_keywords, true)
|
19
12
|
|
20
13
|
# @private
|
21
14
|
def matches?(actual, &block)
|
@@ -72,20 +65,8 @@ module RSpec
|
|
72
65
|
@actual.respond_to? predicate
|
73
66
|
end
|
74
67
|
|
75
|
-
|
76
|
-
|
77
|
-
def predicate_matches?
|
78
|
-
if @kwargs.empty?
|
79
|
-
@actual.__send__(predicate, *@args, &@block)
|
80
|
-
else
|
81
|
-
@actual.__send__(predicate, *@args, **@kwargs, &@block)
|
82
|
-
end
|
83
|
-
end
|
84
|
-
CODE
|
85
|
-
else
|
86
|
-
def predicate_matches?
|
87
|
-
@actual.__send__(predicate, *@args, &@block)
|
88
|
-
end
|
68
|
+
def predicate_matches?
|
69
|
+
@actual.__send__(predicate, *@args, &@block)
|
89
70
|
end
|
90
71
|
|
91
72
|
def predicate
|
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.9.
|
4
|
+
version: 3.9.4
|
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: 2020-10-
|
48
|
+
date: 2020-10-29 00:00:00.000000000 Z
|
49
49
|
dependencies:
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: rspec-support
|
@@ -202,7 +202,7 @@ licenses:
|
|
202
202
|
- MIT
|
203
203
|
metadata:
|
204
204
|
bug_tracker_uri: https://github.com/rspec/rspec-expectations/issues
|
205
|
-
changelog_uri: https://github.com/rspec/rspec-expectations/blob/v3.9.
|
205
|
+
changelog_uri: https://github.com/rspec/rspec-expectations/blob/v3.9.4/Changelog.md
|
206
206
|
documentation_uri: https://rspec.info/documentation/
|
207
207
|
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
208
208
|
source_code_uri: https://github.com/rspec/rspec-expectations
|
@@ -225,5 +225,5 @@ requirements: []
|
|
225
225
|
rubygems_version: 3.1.3
|
226
226
|
signing_key:
|
227
227
|
specification_version: 4
|
228
|
-
summary: rspec-expectations-3.9.
|
228
|
+
summary: rspec-expectations-3.9.4
|
229
229
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|