rspec-mocks 3.12.1 → 3.12.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/Changelog.md +19 -1
- data/lib/rspec/mocks/any_instance/proxy.rb +1 -1
- data/lib/rspec/mocks/argument_list_matcher.rb +3 -1
- data/lib/rspec/mocks/minitest_integration.rb +1 -1
- data/lib/rspec/mocks/mutate_const.rb +1 -1
- data/lib/rspec/mocks/proxy.rb +1 -0
- data/lib/rspec/mocks/verifying_double.rb +2 -0
- data/lib/rspec/mocks/verifying_proxy.rb +4 -3
- 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: 8c8abef40b0c7af1e3c4e31c39dd5ea6b00b0a38585852d6c7f1c0eaafaf4b01
|
4
|
+
data.tar.gz: c96bca0c8abb7db7344dd431f34a3eac93813e476ab20cb7d34709862ef26b64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5174ad99df46d9c45b1e2fddb7564163a46c9bd5c2def07853abc5113a590b50cd752690fa4e89cd103eb57d79a311df144cd6abfb3f60b7dbae9ce170aa73d0
|
7
|
+
data.tar.gz: 924bf170ff82d03b801006aaae1d5457351e8d95c2590cacca34db87d23097b158bc688fb0c0494a2435b1f4dc9540cc63db5ddf63737c514592f54f8b71a29a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
### Development
|
2
|
-
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.3...3-12-maintenance)
|
3
|
+
|
4
|
+
### 3.12.3 / 2023-01-17
|
5
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.2...v3.12.3)
|
6
|
+
|
7
|
+
Bug Fixes:
|
8
|
+
|
9
|
+
* Fix keyword delegation in `send` for verifying doubles on Ruby 3.
|
10
|
+
(Charlie Honig, #1485)
|
11
|
+
|
12
|
+
### 3.12.2 / 2023-01-07
|
13
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.1...v3.12.2)
|
14
|
+
|
15
|
+
Bug Fixes:
|
16
|
+
|
17
|
+
* Fix implementation blocks for mocks using keyword arguments on Ruby 3.2.0.
|
18
|
+
(Adam Steel, #1508)
|
19
|
+
* Fix keyword argument assertions when mocking using `with` on Ruby 3.2.0.
|
20
|
+
(Slava Kardakov, Benoit Tigeot, Phil Pirozhkov, Benoit Daloze, #1514)
|
3
21
|
|
4
22
|
### 3.12.1 / 2022-12-10
|
5
23
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.0...v3.12.1)
|
@@ -10,7 +10,7 @@ module RSpec
|
|
10
10
|
#
|
11
11
|
# This proxy sits in front of the recorder and delegates both to it
|
12
12
|
# and to the `RSpec::Mocks::Proxy` for each already mocked or stubbed
|
13
|
-
# instance of the class, in order to
|
13
|
+
# instance of the class, in order to propagates changes to the instances.
|
14
14
|
#
|
15
15
|
# Note that unlike `RSpec::Mocks::Proxy`, this proxy class is stateless
|
16
16
|
# and is not persisted in `RSpec::Mocks.space`.
|
@@ -61,7 +61,9 @@ module RSpec
|
|
61
61
|
return false if expected_args.size != actual_args.size
|
62
62
|
|
63
63
|
if RUBY_VERSION >= "3"
|
64
|
-
#
|
64
|
+
# If the expectation was set with keywords, while the actual method was called with a positional hash argument, they don't match.
|
65
|
+
# If the expectation was set without keywords, e.g., with({a: 1}), then it fine to call it with either foo(a: 1) or foo({a: 1}).
|
66
|
+
# This corresponds to Ruby semantics, as if the method was def foo(options).
|
65
67
|
if Hash === expected_args.last && Hash === actual_args.last
|
66
68
|
if !Hash.ruby2_keywords_hash?(actual_args.last) && Hash.ruby2_keywords_hash?(expected_args.last)
|
67
69
|
return false
|
@@ -37,7 +37,7 @@ if defined?(::Minitest::Expectation)
|
|
37
37
|
# not want to here (or else we would interfere with rspec-expectations' definition).
|
38
38
|
else
|
39
39
|
# ...otherwise, define those methods now. If `rspec/expectations/minitest_integration`
|
40
|
-
# is loaded after this file, it'll
|
40
|
+
# is loaded after this file, it'll override the definition here.
|
41
41
|
Minitest::Expectation.class_eval do
|
42
42
|
include RSpec::Mocks::ExpectationTargetMethods
|
43
43
|
|
@@ -81,7 +81,7 @@ module RSpec
|
|
81
81
|
# Queries rspec-mocks to find out information about the named constant.
|
82
82
|
#
|
83
83
|
# @param [String] name the name of the constant
|
84
|
-
# @return [Constant] an object
|
84
|
+
# @return [Constant] an object containing information about the named
|
85
85
|
# constant.
|
86
86
|
def self.original(name)
|
87
87
|
mutator = ::RSpec::Mocks.space.constant_mutator_for(name)
|
data/lib/rspec/mocks/proxy.rb
CHANGED
@@ -42,11 +42,13 @@ module RSpec
|
|
42
42
|
ensure
|
43
43
|
@__sending_message = nil
|
44
44
|
end
|
45
|
+
ruby2_keywords :__send__ if respond_to?(:ruby2_keywords, true)
|
45
46
|
$VERBOSE = old
|
46
47
|
|
47
48
|
def send(name, *args, &block)
|
48
49
|
__send__(name, *args, &block)
|
49
50
|
end
|
51
|
+
ruby2_keywords :send if respond_to?(:ruby2_keywords, true)
|
50
52
|
|
51
53
|
def initialize(doubled_module, *args)
|
52
54
|
@doubled_module = doubled_module
|
@@ -57,7 +57,7 @@ module RSpec
|
|
57
57
|
# A verifying proxy mostly acts like a normal proxy, except that it
|
58
58
|
# contains extra logic to try and determine the validity of any expectation
|
59
59
|
# set on it. This includes whether or not methods have been defined and the
|
60
|
-
#
|
60
|
+
# validity of arguments on method calls.
|
61
61
|
#
|
62
62
|
# In all other ways this behaves like a normal proxy. It only adds the
|
63
63
|
# verification behaviour to specific methods then delegates to the parent
|
@@ -147,12 +147,12 @@ module RSpec
|
|
147
147
|
end
|
148
148
|
|
149
149
|
def add_expectation(*args, &block)
|
150
|
-
#
|
150
|
+
# explicit params necessary for 1.8.7 see #626
|
151
151
|
super(*args, &block).tap { |x| x.method_reference = @method_reference }
|
152
152
|
end
|
153
153
|
|
154
154
|
def add_stub(*args, &block)
|
155
|
-
#
|
155
|
+
# explicit params necessary for 1.8.7 see #626
|
156
156
|
super(*args, &block).tap { |x| x.method_reference = @method_reference }
|
157
157
|
end
|
158
158
|
|
@@ -160,6 +160,7 @@ module RSpec
|
|
160
160
|
validate_arguments!(args)
|
161
161
|
super
|
162
162
|
end
|
163
|
+
ruby2_keywords :proxy_method_invoked if respond_to?(:ruby2_keywords, true)
|
163
164
|
|
164
165
|
def validate_arguments!(actual_args)
|
165
166
|
@method_reference.with_signature do |signature|
|
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.12.
|
4
|
+
version: 3.12.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: 2023-01-17 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.12.
|
197
|
+
changelog_uri: https://github.com/rspec/rspec-mocks/blob/v3.12.3/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.26
|
218
218
|
signing_key:
|
219
219
|
specification_version: 4
|
220
|
-
summary: rspec-mocks-3.12.
|
220
|
+
summary: rspec-mocks-3.12.3
|
221
221
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|