rspec-mocks 3.10.0 → 3.12.0
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 +69 -0
- data/README.md +1 -1
- data/lib/rspec/mocks/any_instance/recorder.rb +1 -0
- data/lib/rspec/mocks/argument_list_matcher.rb +18 -3
- data/lib/rspec/mocks/error_generator.rb +11 -0
- data/lib/rspec/mocks/matchers/receive.rb +1 -0
- data/lib/rspec/mocks/matchers/receive_message_chain.rb +1 -1
- data/lib/rspec/mocks/message_expectation.rb +74 -5
- data/lib/rspec/mocks/method_double.rb +4 -0
- data/lib/rspec/mocks/method_reference.rb +14 -2
- data/lib/rspec/mocks/mutate_const.rb +1 -1
- data/lib/rspec/mocks/proxy.rb +22 -0
- data/lib/rspec/mocks/verifying_double.rb +2 -10
- data/lib/rspec/mocks/verifying_message_expectation.rb +1 -0
- data/lib/rspec/mocks/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +14 -14
- 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: 0cd2152d61378a0a88fff67002f2fb7654e420b8e05dae14a9a0dee53be75158
|
4
|
+
data.tar.gz: ae2927214cf12da04ea1301bda73e04663293bd8afce3e028d2937ccfee7332e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19e1b47dd79167753c4f551006b20ec2b3f72ebdf3cd02d10c94c78fe14c5ff808de8a2dcd0b622723aee7c3454bc67f817477edbe877ba181244548d0725956
|
7
|
+
data.tar.gz: 326636f36eb006d142e59b62477c4014a539157bdff50d6e06be4236e00df2eb824e4939f709192d538196a6dd223d7d2efae4bb21fe7392a02afc7744789c9a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,3 +1,72 @@
|
|
1
|
+
### Development
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.0...3-12-maintenance)
|
3
|
+
|
4
|
+
### 3.12.0 / 2022-10-26
|
5
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.11.2...v3.12.0)
|
6
|
+
|
7
|
+
Enhancements:
|
8
|
+
|
9
|
+
* Improve diff output when diffing keyword arguments against hashes.
|
10
|
+
(Jean Boussier, #1461)
|
11
|
+
|
12
|
+
### 3.11.2 / 2022-10-25
|
13
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.11.1...v3.11.2)
|
14
|
+
|
15
|
+
Bug Fixes:
|
16
|
+
|
17
|
+
* Use the original implementation of `Class.new` to detect overridden definitions
|
18
|
+
of `new` rather than the owner, fixing detection of "double aliased" methods
|
19
|
+
in Ruby 3 and above. (Benoit Daloze, #1470, #1476)
|
20
|
+
* Support keyword argument semantics when constraining argument expectations using
|
21
|
+
`with` on Ruby 3.0+ with `instance_double` (Andrii Malyshko, #1473)
|
22
|
+
|
23
|
+
### 3.11.1 / 2022-03-31
|
24
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.11.0...v3.11.1)
|
25
|
+
|
26
|
+
Bug Fixes:
|
27
|
+
|
28
|
+
* Add extra `ruby2_keywords` calls to properly designate methods using
|
29
|
+
`*args` to pass keyword around, fixes an issue with TruffleRuby.
|
30
|
+
(Benoit Daloze, #1464)
|
31
|
+
|
32
|
+
### 3.11.0 / 2022-02-09
|
33
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.3...v3.11.0)
|
34
|
+
|
35
|
+
Enhancements:
|
36
|
+
|
37
|
+
* Add `and_invoke` implementation for configuring responses to `receive`
|
38
|
+
(and `receive_messages`) with multiple callable objects. (Kyle Smith, #1411)
|
39
|
+
|
40
|
+
### 3.10.3 / 2022-01-28
|
41
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.2...v3.10.3)
|
42
|
+
|
43
|
+
Bug Fixes:
|
44
|
+
|
45
|
+
* Suppress warning by setting `$VERBOSE` to nil. (Nobuyoshi Nakada, #1414)
|
46
|
+
* Support keyword argument semantics when constraining argument expectations using
|
47
|
+
`with` on Ruby 3.0+ (Yusuke Endoh, #1394)
|
48
|
+
|
49
|
+
### 3.10.2 / 2021-01-27
|
50
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.1...v3.10.2)
|
51
|
+
|
52
|
+
Bug Fixes:
|
53
|
+
|
54
|
+
* Support keyword arguments with `and_call_original` on Ruby 3.0.
|
55
|
+
(Bryan Powell, #1385)
|
56
|
+
* `RSpec::Mocks::Constant#previously_defined?` is now always a boolean.
|
57
|
+
(Phil Pirozhkov, #1397)
|
58
|
+
* Support keyword arguments on Ruby 3.0 when used with `expect_any_instance_of`
|
59
|
+
or `allow_any_instance_of` with `and_call_original`.
|
60
|
+
(Jess Hottenstein, #1407)
|
61
|
+
|
62
|
+
### 3.10.1 / 2020-12-27
|
63
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.0...v3.10.1)
|
64
|
+
|
65
|
+
Bug Fixes:
|
66
|
+
|
67
|
+
* Issue `ArgumentError` rather than `TypeError` when unsupported methods on
|
68
|
+
unsupported objects are attempted to be stubbed. (@zhisme, #1357)
|
69
|
+
|
1
70
|
### 3.10.0 / 2020-10-30
|
2
71
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.9.1...v3.10.0)
|
3
72
|
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# RSpec Mocks [](https://github.com/rspec/rspec-mocks/actions) [](https://codeclimate.com/github/rspec/rspec-mocks)
|
2
2
|
rspec-mocks is a test-double framework for rspec with support for method stubs,
|
3
3
|
fakes, and message expectations on generated test-doubles and real objects
|
4
4
|
alike.
|
@@ -46,17 +46,32 @@ module RSpec
|
|
46
46
|
@expected_args = expected_args
|
47
47
|
ensure_expected_args_valid!
|
48
48
|
end
|
49
|
+
ruby2_keywords :initialize if respond_to?(:ruby2_keywords, true)
|
49
50
|
|
50
51
|
# @api public
|
51
|
-
# @param [Array]
|
52
|
+
# @param [Array] actual_args
|
52
53
|
#
|
53
54
|
# Matches each element in the `expected_args` against the element in the same
|
54
55
|
# position of the arguments passed to `new`.
|
55
56
|
#
|
56
57
|
# @see #initialize
|
57
|
-
def args_match?(*
|
58
|
-
|
58
|
+
def args_match?(*actual_args)
|
59
|
+
expected_args = resolve_expected_args_based_on(actual_args)
|
60
|
+
|
61
|
+
return false if expected_args.size != actual_args.size
|
62
|
+
|
63
|
+
if RUBY_VERSION >= "3"
|
64
|
+
# if both arguments end with Hashes, and if one is a keyword hash and the other is not, they don't match
|
65
|
+
if Hash === expected_args.last && Hash === actual_args.last
|
66
|
+
if !Hash.ruby2_keywords_hash?(actual_args.last) && Hash.ruby2_keywords_hash?(expected_args.last)
|
67
|
+
return false
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
Support::FuzzyMatcher.values_match?(expected_args, actual_args)
|
59
73
|
end
|
74
|
+
ruby2_keywords :args_match? if respond_to?(:ruby2_keywords, true)
|
60
75
|
|
61
76
|
# @private
|
62
77
|
# Resolves abstract arg placeholders like `no_args` and `any_args` into
|
@@ -268,6 +268,17 @@ module RSpec
|
|
268
268
|
def error_message(expectation, args_for_multiple_calls)
|
269
269
|
expected_args = format_args(expectation.expected_args)
|
270
270
|
actual_args = format_received_args(args_for_multiple_calls)
|
271
|
+
|
272
|
+
if RSpec::Support::RubyFeatures.distincts_kw_args_from_positional_hash? && expected_args == actual_args
|
273
|
+
expected_hash = expectation.expected_args.last
|
274
|
+
actual_hash = args_for_multiple_calls.last.last
|
275
|
+
if Hash === expected_hash && Hash === actual_hash &&
|
276
|
+
(Hash.ruby2_keywords_hash?(expected_hash) != Hash.ruby2_keywords_hash?(actual_hash))
|
277
|
+
actual_args += Hash.ruby2_keywords_hash?(actual_hash) ? " (keyword arguments)" : " (options hash)"
|
278
|
+
expected_args += Hash.ruby2_keywords_hash?(expected_hash) ? " (keyword arguments)" : " (options hash)"
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
271
282
|
message = default_error_message(expectation, expected_args, actual_args)
|
272
283
|
|
273
284
|
if args_for_multiple_calls.one?
|
@@ -13,7 +13,7 @@ module RSpec
|
|
13
13
|
@recorded_customizations = []
|
14
14
|
end
|
15
15
|
|
16
|
-
[:with, :and_return, :and_throw, :and_raise, :and_yield, :and_call_original].each do |msg|
|
16
|
+
[:with, :and_return, :and_invoke, :and_throw, :and_raise, :and_yield, :and_call_original].each do |msg|
|
17
17
|
define_method(msg) do |*args, &block|
|
18
18
|
@recorded_customizations << ExpectationCustomization.new(msg, args, block)
|
19
19
|
self
|
@@ -53,7 +53,7 @@ module RSpec
|
|
53
53
|
# etc.
|
54
54
|
#
|
55
55
|
# If the message is received more times than there are values, the last
|
56
|
-
# value is
|
56
|
+
# value is returned for every subsequent call.
|
57
57
|
#
|
58
58
|
# @return [nil] No further chaining is supported after this.
|
59
59
|
# @example
|
@@ -85,6 +85,48 @@ module RSpec
|
|
85
85
|
nil
|
86
86
|
end
|
87
87
|
|
88
|
+
# Tells the object to invoke a Proc when it receives the message. Given
|
89
|
+
# more than one value, the result of the first Proc is returned the first
|
90
|
+
# time the message is received, the result of the second Proc is returned
|
91
|
+
# the next time, etc, etc.
|
92
|
+
#
|
93
|
+
# If the message is received more times than there are Procs, the result of
|
94
|
+
# the last Proc is returned for every subsequent call.
|
95
|
+
#
|
96
|
+
# @return [nil] No further chaining is supported after this.
|
97
|
+
# @example
|
98
|
+
# allow(api).to receive(:get_foo).and_invoke(-> { raise ApiTimeout })
|
99
|
+
# api.get_foo # => raises ApiTimeout
|
100
|
+
# api.get_foo # => raises ApiTimeout
|
101
|
+
#
|
102
|
+
# allow(api).to receive(:get_foo).and_invoke(-> { raise ApiTimeout }, -> { raise ApiTimeout }, -> { :a_foo })
|
103
|
+
# api.get_foo # => raises ApiTimeout
|
104
|
+
# api.get_foo # => rasies ApiTimeout
|
105
|
+
# api.get_foo # => :a_foo
|
106
|
+
# api.get_foo # => :a_foo
|
107
|
+
# api.get_foo # => :a_foo
|
108
|
+
# # etc
|
109
|
+
def and_invoke(first_proc, *procs)
|
110
|
+
raise_already_invoked_error_if_necessary(__method__)
|
111
|
+
if negative?
|
112
|
+
raise "`and_invoke` is not supported with negative message expectations"
|
113
|
+
end
|
114
|
+
|
115
|
+
if block_given?
|
116
|
+
raise ArgumentError, "Implementation blocks aren't supported with `and_invoke`"
|
117
|
+
end
|
118
|
+
|
119
|
+
procs.unshift(first_proc)
|
120
|
+
if procs.any? { |p| !p.respond_to?(:call) }
|
121
|
+
raise ArgumentError, "Arguments to `and_invoke` must be callable."
|
122
|
+
end
|
123
|
+
|
124
|
+
@expected_received_count = [@expected_received_count, procs.size].max unless ignoring_args? || (@expected_received_count == 0 && @at_least)
|
125
|
+
self.terminal_implementation_action = AndInvokeImplementation.new(procs)
|
126
|
+
|
127
|
+
nil
|
128
|
+
end
|
129
|
+
|
88
130
|
# Tells the object to delegate to the original unmodified method
|
89
131
|
# when it receives the message.
|
90
132
|
#
|
@@ -97,9 +139,12 @@ module RSpec
|
|
97
139
|
# counter.increment
|
98
140
|
# expect(counter.count).to eq(original_count + 1)
|
99
141
|
def and_call_original
|
100
|
-
|
101
|
-
original.call(*args, &
|
142
|
+
block = lambda do |original, *args, &b|
|
143
|
+
original.call(*args, &b)
|
102
144
|
end
|
145
|
+
block = block.ruby2_keywords if block.respond_to?(:ruby2_keywords)
|
146
|
+
|
147
|
+
wrap_original(__method__, &block)
|
103
148
|
end
|
104
149
|
|
105
150
|
# Decorates the stubbed method with the supplied block. The original
|
@@ -322,6 +367,7 @@ module RSpec
|
|
322
367
|
@argument_list_matcher = ArgumentListMatcher.new(*args)
|
323
368
|
self
|
324
369
|
end
|
370
|
+
ruby2_keywords(:with) if respond_to?(:ruby2_keywords, true)
|
325
371
|
|
326
372
|
# Expect messages to be received in a specific order.
|
327
373
|
#
|
@@ -360,7 +406,6 @@ module RSpec
|
|
360
406
|
# some collaborators it delegates to for this stuff but for now this was
|
361
407
|
# the simplest way to split the public from private stuff to make it
|
362
408
|
# easier to publish the docs for the APIs we want published.
|
363
|
-
# rubocop:disable Metrics/ModuleLength
|
364
409
|
module ImplementationDetails
|
365
410
|
attr_accessor :error_generator, :implementation
|
366
411
|
attr_reader :message
|
@@ -418,18 +463,22 @@ module RSpec
|
|
418
463
|
def matches?(message, *args)
|
419
464
|
@message == message && @argument_list_matcher.args_match?(*args)
|
420
465
|
end
|
466
|
+
ruby2_keywords :matches? if respond_to?(:ruby2_keywords, true)
|
421
467
|
|
422
468
|
def safe_invoke(parent_stub, *args, &block)
|
423
469
|
invoke_incrementing_actual_calls_by(1, false, parent_stub, *args, &block)
|
424
470
|
end
|
471
|
+
ruby2_keywords :safe_invoke if respond_to?(:ruby2_keywords, true)
|
425
472
|
|
426
473
|
def invoke(parent_stub, *args, &block)
|
427
474
|
invoke_incrementing_actual_calls_by(1, true, parent_stub, *args, &block)
|
428
475
|
end
|
476
|
+
ruby2_keywords :invoke if respond_to?(:ruby2_keywords, true)
|
429
477
|
|
430
478
|
def invoke_without_incrementing_received_count(parent_stub, *args, &block)
|
431
479
|
invoke_incrementing_actual_calls_by(0, true, parent_stub, *args, &block)
|
432
480
|
end
|
481
|
+
ruby2_keywords :invoke_without_incrementing_received_count if respond_to?(:ruby2_keywords, true)
|
433
482
|
|
434
483
|
def negative?
|
435
484
|
@expected_received_count == 0 && !@at_least
|
@@ -578,6 +627,7 @@ module RSpec
|
|
578
627
|
@actual_received_count += increment
|
579
628
|
end
|
580
629
|
end
|
630
|
+
ruby2_keywords :invoke_incrementing_actual_calls_by if respond_to?(:ruby2_keywords, true)
|
581
631
|
|
582
632
|
def has_been_invoked?
|
583
633
|
@actual_received_count > 0
|
@@ -635,7 +685,6 @@ module RSpec
|
|
635
685
|
nil
|
636
686
|
end
|
637
687
|
end
|
638
|
-
# rubocop:enable Metrics/ModuleLength
|
639
688
|
|
640
689
|
include ImplementationDetails
|
641
690
|
end
|
@@ -683,6 +732,24 @@ module RSpec
|
|
683
732
|
end
|
684
733
|
end
|
685
734
|
|
735
|
+
# Handles the implementation of an `and_invoke` implementation.
|
736
|
+
# @private
|
737
|
+
class AndInvokeImplementation
|
738
|
+
def initialize(procs_to_invoke)
|
739
|
+
@procs_to_invoke = procs_to_invoke
|
740
|
+
end
|
741
|
+
|
742
|
+
def call(*args, &block)
|
743
|
+
proc = if @procs_to_invoke.size > 1
|
744
|
+
@procs_to_invoke.shift
|
745
|
+
else
|
746
|
+
@procs_to_invoke.first
|
747
|
+
end
|
748
|
+
|
749
|
+
proc.call(*args, &block)
|
750
|
+
end
|
751
|
+
end
|
752
|
+
|
686
753
|
# Represents a configured implementation. Takes into account
|
687
754
|
# any number of sub-implementations.
|
688
755
|
# @private
|
@@ -694,6 +761,7 @@ module RSpec
|
|
694
761
|
action.call(*args, &block)
|
695
762
|
end.last
|
696
763
|
end
|
764
|
+
ruby2_keywords :call if respond_to?(:ruby2_keywords, true)
|
697
765
|
|
698
766
|
def present?
|
699
767
|
actions.any?
|
@@ -739,6 +807,7 @@ module RSpec
|
|
739
807
|
def call(*args, &block)
|
740
808
|
@block.call(@method, *args, &block)
|
741
809
|
end
|
810
|
+
ruby2_keywords :call if respond_to?(:ruby2_keywords, true)
|
742
811
|
|
743
812
|
private
|
744
813
|
|
@@ -63,6 +63,9 @@ 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
|
68
|
+
ruby2_keywords(method_name) if Module.private_method_defined?(:ruby2_keywords)
|
66
69
|
__send__(visibility, method_name)
|
67
70
|
end
|
68
71
|
|
@@ -76,6 +79,7 @@ module RSpec
|
|
76
79
|
def proxy_method_invoked(_obj, *args, &block)
|
77
80
|
@proxy.message_received method_name, *args, &block
|
78
81
|
end
|
82
|
+
ruby2_keywords :proxy_method_invoked if respond_to?(:ruby2_keywords, true)
|
79
83
|
|
80
84
|
# @private
|
81
85
|
def restore_original_method
|
@@ -185,11 +185,23 @@ module RSpec
|
|
185
185
|
def self.applies_to?(method_name)
|
186
186
|
return false unless method_name == :new
|
187
187
|
klass = yield
|
188
|
-
return false unless klass.respond_to?(:new, true)
|
188
|
+
return false unless ::Class === klass && klass.respond_to?(:new, true)
|
189
189
|
|
190
190
|
# We only want to apply our special logic to normal `new` methods.
|
191
191
|
# Methods that the user has monkeyed with should be left as-is.
|
192
|
-
|
192
|
+
uses_class_new?(klass)
|
193
|
+
end
|
194
|
+
|
195
|
+
if RUBY_VERSION.to_i >= 3
|
196
|
+
CLASS_NEW = ::Class.instance_method(:new)
|
197
|
+
|
198
|
+
def self.uses_class_new?(klass)
|
199
|
+
::RSpec::Support.method_handle_for(klass, :new) == CLASS_NEW.bind(klass)
|
200
|
+
end
|
201
|
+
else # Ruby 2's Method#== is too strict
|
202
|
+
def self.uses_class_new?(klass)
|
203
|
+
::RSpec::Support.method_handle_for(klass, :new).owner == ::Class
|
204
|
+
end
|
193
205
|
end
|
194
206
|
|
195
207
|
def with_signature
|
data/lib/rspec/mocks/proxy.rb
CHANGED
@@ -21,6 +21,8 @@ module RSpec
|
|
21
21
|
|
22
22
|
# @private
|
23
23
|
def initialize(object, order_group, options={})
|
24
|
+
ensure_can_be_proxied!(object)
|
25
|
+
|
24
26
|
@object = object
|
25
27
|
@order_group = order_group
|
26
28
|
@error_generator = ErrorGenerator.new(object)
|
@@ -31,6 +33,20 @@ module RSpec
|
|
31
33
|
@method_doubles = Hash.new { |h, k| h[k] = MethodDouble.new(@object, k, self) }
|
32
34
|
end
|
33
35
|
|
36
|
+
# @private
|
37
|
+
def ensure_can_be_proxied!(object)
|
38
|
+
return unless object.is_a?(Symbol) || object.frozen?
|
39
|
+
return if object.nil?
|
40
|
+
|
41
|
+
msg = "Cannot proxy frozen objects"
|
42
|
+
if Symbol === object
|
43
|
+
msg << ". Symbols such as #{object} cannot be mocked or stubbed."
|
44
|
+
else
|
45
|
+
msg << ", rspec-mocks relies on proxies for method stubbing and expectations."
|
46
|
+
end
|
47
|
+
raise ArgumentError, msg
|
48
|
+
end
|
49
|
+
|
34
50
|
# @private
|
35
51
|
attr_reader :object
|
36
52
|
|
@@ -214,6 +230,7 @@ module RSpec
|
|
214
230
|
@object.__send__(:method_missing, message, *args, &block)
|
215
231
|
end
|
216
232
|
end
|
233
|
+
ruby2_keywords :message_received if respond_to?(:ruby2_keywords, true)
|
217
234
|
|
218
235
|
# @private
|
219
236
|
def raise_unexpected_message_error(method_name, args)
|
@@ -263,12 +280,14 @@ module RSpec
|
|
263
280
|
expectation.matches?(method_name, *args)
|
264
281
|
end
|
265
282
|
end
|
283
|
+
ruby2_keywords :find_matching_expectation if respond_to?(:ruby2_keywords, true)
|
266
284
|
|
267
285
|
def find_almost_matching_expectation(method_name, *args)
|
268
286
|
find_best_matching_expectation_for(method_name) do |expectation|
|
269
287
|
expectation.matches_name_but_not_args(method_name, *args)
|
270
288
|
end
|
271
289
|
end
|
290
|
+
ruby2_keywords :find_almost_matching_expectation if respond_to?(:ruby2_keywords, true)
|
272
291
|
|
273
292
|
def find_best_matching_expectation_for(method_name)
|
274
293
|
first_match = nil
|
@@ -285,10 +304,12 @@ module RSpec
|
|
285
304
|
def find_matching_method_stub(method_name, *args)
|
286
305
|
method_double_for(method_name).stubs.find { |stub| stub.matches?(method_name, *args) }
|
287
306
|
end
|
307
|
+
ruby2_keywords :find_matching_method_stub if respond_to?(:ruby2_keywords, true)
|
288
308
|
|
289
309
|
def find_almost_matching_stub(method_name, *args)
|
290
310
|
method_double_for(method_name).stubs.find { |stub| stub.matches_name_but_not_args(method_name, *args) }
|
291
311
|
end
|
312
|
+
ruby2_keywords :find_almost_matching_stub if respond_to?(:ruby2_keywords, true)
|
292
313
|
end
|
293
314
|
|
294
315
|
# @private
|
@@ -344,6 +365,7 @@ module RSpec
|
|
344
365
|
end
|
345
366
|
super
|
346
367
|
end
|
368
|
+
ruby2_keywords :message_received if respond_to?(:ruby2_keywords, true)
|
347
369
|
|
348
370
|
private
|
349
371
|
|
@@ -34,23 +34,15 @@ module RSpec
|
|
34
34
|
super
|
35
35
|
end
|
36
36
|
|
37
|
-
# @private
|
38
|
-
module SilentIO
|
39
|
-
def self.method_missing(*); end
|
40
|
-
def self.respond_to?(*)
|
41
|
-
true
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
37
|
# Redefining `__send__` causes ruby to issue a warning.
|
46
|
-
old, $
|
38
|
+
old, $VERBOSE = $VERBOSE, nil
|
47
39
|
def __send__(name, *args, &block)
|
48
40
|
@__sending_message = name
|
49
41
|
super
|
50
42
|
ensure
|
51
43
|
@__sending_message = nil
|
52
44
|
end
|
53
|
-
$
|
45
|
+
$VERBOSE = old
|
54
46
|
|
55
47
|
def send(name, *args, &block)
|
56
48
|
__send__(name, *args, &block)
|
data/lib/rspec/mocks/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-mocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Baker
|
8
8
|
- David Chelimsky
|
9
9
|
- Myron Marston
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain:
|
13
13
|
- |
|
@@ -45,7 +45,7 @@ cert_chain:
|
|
45
45
|
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
46
46
|
F3MdtaDehhjC
|
47
47
|
-----END CERTIFICATE-----
|
48
|
-
date:
|
48
|
+
date: 2022-10-26 00:00:00.000000000 Z
|
49
49
|
dependencies:
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: rspec-support
|
@@ -53,14 +53,14 @@ dependencies:
|
|
53
53
|
requirements:
|
54
54
|
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 3.
|
56
|
+
version: 3.12.0
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - "~>"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 3.
|
63
|
+
version: 3.12.0
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: diff-lcs
|
66
66
|
requirement: !ruby/object:Gem::Requirement
|
@@ -99,16 +99,16 @@ dependencies:
|
|
99
99
|
name: cucumber
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- - "
|
102
|
+
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: 1.3
|
104
|
+
version: '1.3'
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- - "
|
109
|
+
- - ">="
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 1.3
|
111
|
+
version: '1.3'
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: aruba
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -194,11 +194,11 @@ 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.
|
197
|
+
changelog_uri: https://github.com/rspec/rspec-mocks/blob/v3.12.0/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
|
201
|
-
post_install_message:
|
201
|
+
post_install_message:
|
202
202
|
rdoc_options:
|
203
203
|
- "--charset=UTF-8"
|
204
204
|
require_paths:
|
@@ -214,8 +214,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
214
214
|
- !ruby/object:Gem::Version
|
215
215
|
version: '0'
|
216
216
|
requirements: []
|
217
|
-
rubygems_version: 3.1.
|
218
|
-
signing_key:
|
217
|
+
rubygems_version: 3.1.6
|
218
|
+
signing_key:
|
219
219
|
specification_version: 4
|
220
|
-
summary: rspec-mocks-3.
|
220
|
+
summary: rspec-mocks-3.12.0
|
221
221
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|