rspec-mocks 3.11.0 → 3.11.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/Changelog.md +10 -1
- data/lib/rspec/mocks/argument_list_matcher.rb +2 -1
- data/lib/rspec/mocks/matchers/receive.rb +1 -1
- data/lib/rspec/mocks/message_expectation.rb +13 -3
- data/lib/rspec/mocks/method_double.rb +3 -0
- data/lib/rspec/mocks/proxy.rb +6 -0
- data/lib/rspec/mocks/version.rb +1 -1
- data.tar.gz.sig +0 -0
- 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: 93e990c0ca803cda14a587b44a4a6148fd60df472f56e58c54be5a2c8ef4a655
|
4
|
+
data.tar.gz: db0535d24fb98fa0da5c5de3356b687e1b95773624dd38132444f74a57c5d0b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e74e72aec89ffce718f693bfda425f142bfd7139d90c57ff02e62ac461d99f9458df2ffba237bd9163e1665fd9b03a0221f723552d84bffb539a567c3b98f71
|
7
|
+
data.tar.gz: 6b2b9c447b777b74fcf50eb62a9674b0a4e321cf71165d340017f1ec9050a676c818a608d4d99bb5bb9c1178f44e57505e52c750b22520cb868b05b02812bfc2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
### Development
|
2
|
-
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.11.
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.11.1...3-11-maintenance)
|
3
|
+
|
4
|
+
### 3.11.1 / 2022-03-31
|
5
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.11.0...v3.11.1)
|
6
|
+
|
7
|
+
Bug Fixes:
|
8
|
+
|
9
|
+
* Add extra `ruby2_keywords` calls to properly designate methods using
|
10
|
+
`*args` to pass keyword around, fixes an issue with TruffleRuby.
|
11
|
+
(Benoit Daloze, #1464)
|
3
12
|
|
4
13
|
### 3.11.0 / 2022-02-09
|
5
14
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.3...v3.11.0)
|
@@ -46,7 +46,7 @@ module RSpec
|
|
46
46
|
@expected_args = expected_args
|
47
47
|
ensure_expected_args_valid!
|
48
48
|
end
|
49
|
-
ruby2_keywords :initialize if
|
49
|
+
ruby2_keywords :initialize if respond_to?(:ruby2_keywords, true)
|
50
50
|
|
51
51
|
# @api public
|
52
52
|
# @param [Array] actual_args
|
@@ -71,6 +71,7 @@ module RSpec
|
|
71
71
|
|
72
72
|
Support::FuzzyMatcher.values_match?(expected_args, actual_args)
|
73
73
|
end
|
74
|
+
ruby2_keywords :args_match? if respond_to?(:ruby2_keywords, true)
|
74
75
|
|
75
76
|
# @private
|
76
77
|
# Resolves abstract arg placeholders like `no_args` and `any_args` into
|
@@ -62,7 +62,7 @@ module RSpec
|
|
62
62
|
@recorded_customizations << ExpectationCustomization.new(method, args, block)
|
63
63
|
self
|
64
64
|
end
|
65
|
-
ruby2_keywords(method) if
|
65
|
+
ruby2_keywords(method) if respond_to?(:ruby2_keywords, true)
|
66
66
|
end
|
67
67
|
|
68
68
|
private
|
@@ -139,9 +139,12 @@ module RSpec
|
|
139
139
|
# counter.increment
|
140
140
|
# expect(counter.count).to eq(original_count + 1)
|
141
141
|
def and_call_original
|
142
|
-
|
143
|
-
original.call(*args, &
|
142
|
+
block = lambda do |original, *args, &b|
|
143
|
+
original.call(*args, &b)
|
144
144
|
end
|
145
|
+
block = block.ruby2_keywords if block.respond_to?(:ruby2_keywords)
|
146
|
+
|
147
|
+
wrap_original(__method__, &block)
|
145
148
|
end
|
146
149
|
|
147
150
|
# Decorates the stubbed method with the supplied block. The original
|
@@ -364,7 +367,7 @@ module RSpec
|
|
364
367
|
@argument_list_matcher = ArgumentListMatcher.new(*args)
|
365
368
|
self
|
366
369
|
end
|
367
|
-
ruby2_keywords(:with) if
|
370
|
+
ruby2_keywords(:with) if respond_to?(:ruby2_keywords, true)
|
368
371
|
|
369
372
|
# Expect messages to be received in a specific order.
|
370
373
|
#
|
@@ -461,18 +464,22 @@ module RSpec
|
|
461
464
|
def matches?(message, *args)
|
462
465
|
@message == message && @argument_list_matcher.args_match?(*args)
|
463
466
|
end
|
467
|
+
ruby2_keywords :matches? if respond_to?(:ruby2_keywords, true)
|
464
468
|
|
465
469
|
def safe_invoke(parent_stub, *args, &block)
|
466
470
|
invoke_incrementing_actual_calls_by(1, false, parent_stub, *args, &block)
|
467
471
|
end
|
472
|
+
ruby2_keywords :safe_invoke if respond_to?(:ruby2_keywords, true)
|
468
473
|
|
469
474
|
def invoke(parent_stub, *args, &block)
|
470
475
|
invoke_incrementing_actual_calls_by(1, true, parent_stub, *args, &block)
|
471
476
|
end
|
477
|
+
ruby2_keywords :invoke if respond_to?(:ruby2_keywords, true)
|
472
478
|
|
473
479
|
def invoke_without_incrementing_received_count(parent_stub, *args, &block)
|
474
480
|
invoke_incrementing_actual_calls_by(0, true, parent_stub, *args, &block)
|
475
481
|
end
|
482
|
+
ruby2_keywords :invoke_without_incrementing_received_count if respond_to?(:ruby2_keywords, true)
|
476
483
|
|
477
484
|
def negative?
|
478
485
|
@expected_received_count == 0 && !@at_least
|
@@ -621,6 +628,7 @@ module RSpec
|
|
621
628
|
@actual_received_count += increment
|
622
629
|
end
|
623
630
|
end
|
631
|
+
ruby2_keywords :invoke_incrementing_actual_calls_by if respond_to?(:ruby2_keywords, true)
|
624
632
|
|
625
633
|
def has_been_invoked?
|
626
634
|
@actual_received_count > 0
|
@@ -755,6 +763,7 @@ module RSpec
|
|
755
763
|
action.call(*args, &block)
|
756
764
|
end.last
|
757
765
|
end
|
766
|
+
ruby2_keywords :call if respond_to?(:ruby2_keywords, true)
|
758
767
|
|
759
768
|
def present?
|
760
769
|
actions.any?
|
@@ -800,6 +809,7 @@ module RSpec
|
|
800
809
|
def call(*args, &block)
|
801
810
|
@block.call(@method, *args, &block)
|
802
811
|
end
|
812
|
+
ruby2_keywords :call if respond_to?(:ruby2_keywords, true)
|
803
813
|
|
804
814
|
private
|
805
815
|
|
@@ -63,6 +63,8 @@ module RSpec
|
|
63
63
|
define_method(method_name) do |*args, &block|
|
64
64
|
method_double.proxy_method_invoked(self, *args, &block)
|
65
65
|
end
|
66
|
+
# This can't be `if respond_to?(:ruby2_keywords, true)`,
|
67
|
+
# see https://github.com/rspec/rspec-mocks/pull/1385#issuecomment-755340298
|
66
68
|
ruby2_keywords(method_name) if Module.private_method_defined?(:ruby2_keywords)
|
67
69
|
__send__(visibility, method_name)
|
68
70
|
end
|
@@ -77,6 +79,7 @@ module RSpec
|
|
77
79
|
def proxy_method_invoked(_obj, *args, &block)
|
78
80
|
@proxy.message_received method_name, *args, &block
|
79
81
|
end
|
82
|
+
ruby2_keywords :proxy_method_invoked if respond_to?(:ruby2_keywords, true)
|
80
83
|
|
81
84
|
# @private
|
82
85
|
def restore_original_method
|
data/lib/rspec/mocks/proxy.rb
CHANGED
@@ -230,6 +230,7 @@ module RSpec
|
|
230
230
|
@object.__send__(:method_missing, message, *args, &block)
|
231
231
|
end
|
232
232
|
end
|
233
|
+
ruby2_keywords :message_received if respond_to?(:ruby2_keywords, true)
|
233
234
|
|
234
235
|
# @private
|
235
236
|
def raise_unexpected_message_error(method_name, args)
|
@@ -279,12 +280,14 @@ module RSpec
|
|
279
280
|
expectation.matches?(method_name, *args)
|
280
281
|
end
|
281
282
|
end
|
283
|
+
ruby2_keywords :find_matching_expectation if respond_to?(:ruby2_keywords, true)
|
282
284
|
|
283
285
|
def find_almost_matching_expectation(method_name, *args)
|
284
286
|
find_best_matching_expectation_for(method_name) do |expectation|
|
285
287
|
expectation.matches_name_but_not_args(method_name, *args)
|
286
288
|
end
|
287
289
|
end
|
290
|
+
ruby2_keywords :find_almost_matching_expectation if respond_to?(:ruby2_keywords, true)
|
288
291
|
|
289
292
|
def find_best_matching_expectation_for(method_name)
|
290
293
|
first_match = nil
|
@@ -301,10 +304,12 @@ module RSpec
|
|
301
304
|
def find_matching_method_stub(method_name, *args)
|
302
305
|
method_double_for(method_name).stubs.find { |stub| stub.matches?(method_name, *args) }
|
303
306
|
end
|
307
|
+
ruby2_keywords :find_matching_method_stub if respond_to?(:ruby2_keywords, true)
|
304
308
|
|
305
309
|
def find_almost_matching_stub(method_name, *args)
|
306
310
|
method_double_for(method_name).stubs.find { |stub| stub.matches_name_but_not_args(method_name, *args) }
|
307
311
|
end
|
312
|
+
ruby2_keywords :find_almost_matching_stub if respond_to?(:ruby2_keywords, true)
|
308
313
|
end
|
309
314
|
|
310
315
|
# @private
|
@@ -360,6 +365,7 @@ module RSpec
|
|
360
365
|
end
|
361
366
|
super
|
362
367
|
end
|
368
|
+
ruby2_keywords :message_received if respond_to?(:ruby2_keywords, true)
|
363
369
|
|
364
370
|
private
|
365
371
|
|
data/lib/rspec/mocks/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-mocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.11.
|
4
|
+
version: 3.11.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: 2022-
|
48
|
+
date: 2022-03-31 00:00:00.000000000 Z
|
49
49
|
dependencies:
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: rspec-support
|
@@ -194,7 +194,7 @@ licenses:
|
|
194
194
|
- MIT
|
195
195
|
metadata:
|
196
196
|
bug_tracker_uri: https://github.com/rspec/rspec-mocks/issues
|
197
|
-
changelog_uri: https://github.com/rspec/rspec-mocks/blob/v3.11.
|
197
|
+
changelog_uri: https://github.com/rspec/rspec-mocks/blob/v3.11.1/Changelog.md
|
198
198
|
documentation_uri: https://rspec.info/documentation/
|
199
199
|
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
200
200
|
source_code_uri: https://github.com/rspec/rspec-mocks
|
@@ -217,5 +217,5 @@ requirements: []
|
|
217
217
|
rubygems_version: 3.3.3
|
218
218
|
signing_key:
|
219
219
|
specification_version: 4
|
220
|
-
summary: rspec-mocks-3.11.
|
220
|
+
summary: rspec-mocks-3.11.1
|
221
221
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|