rspec-expectations 3.9.3 → 3.9.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba515bcbb264eef62d6948840e73b71ef3a68ed947d2e711df04fdf1b04fa4ec
4
- data.tar.gz: ba8501df256831e843786ca4f78cc7825e8ad6dca125191beda504de0c1d16e7
3
+ metadata.gz: 0a7b90c1caeec07d53054eb0536482494c2584e6d7cb0fc9cfd3493ebc6b27a7
4
+ data.tar.gz: 2eed511b0562ee702eb71bda98058c61d9ddda6c7b0337adde7acd72ddfb81df
5
5
  SHA512:
6
- metadata.gz: ac2ff1267b689ba5daf08898a11ff97f1f2554db817f43135a6b1d96bcada94f03d728ddda4050158fcf8a483b8295644457aea810d18b37686d5aa253007917
7
- data.tar.gz: 6527bed095e09131e0e8a50f12784d017953f073b4099d710df7fff638f632d03bedba40836adeba6aa33f51d9d4c501f795c364c6e1304ddc8c41225df2c18d
6
+ metadata.gz: 7d0ea4666034e2901450f23fe706d1258f0b2c37ac7edd823477e31eae7c6d56e597a0b728cea0fe5f12ab80ee43ac4ed1a5c203ef34f66d180b40713adedf81
7
+ data.tar.gz: 3b42d8706be59eb0dd511497941c34cebaff7476394f3f1ca80326d26c362bf3b37cca520ae0c6002a8efe167ee3fe7707e41e53072ac000c8c2a89f960fa6c0
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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
 
@@ -2,7 +2,7 @@ module RSpec
2
2
  module Expectations
3
3
  # @private
4
4
  module Version
5
- STRING = '3.9.3'
5
+ STRING = '3.9.4'
6
6
  end
7
7
  end
8
8
  end
@@ -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
- if RSpec::Support::RubyFeatures.kw_args_supported?
957
- binding.eval(<<-CODE, __FILE__, __LINE__)
958
- def method_missing(method, *args, **kwargs, &block)
959
- case method.to_s
960
- when BE_PREDICATE_REGEX
961
- BuiltIn::BePredicate.new(method, *args, **kwargs, &block)
962
- when HAS_REGEX
963
- BuiltIn::Has.new(method, *args, **kwargs, &block)
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
- if RSpec::Support::RubyFeatures.kw_args_supported?
197
- binding.eval(<<-CODE, __FILE__, __LINE__)
198
- def initialize(*args, **kwargs, &block)
199
- @expected = parse_expected(args.shift)
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
- if RSpec::Support::RubyFeatures.kw_args_supported?
263
- binding.eval(<<-CODE, __FILE__, __LINE__)
264
- def predicate_matches?
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
- if RSpec::Support::RubyFeatures.kw_args_supported?
9
- binding.eval(<<-CODE, __FILE__, __LINE__)
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
- if RSpec::Support::RubyFeatures.kw_args_supported?
76
- binding.eval(<<-CODE, __FILE__, __LINE__)
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.3
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-23 00:00:00.000000000 Z
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.3/Changelog.md
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.3
228
+ summary: rspec-expectations-3.9.4
229
229
  test_files: []
metadata.gz.sig CHANGED
Binary file