rspec-mocks 3.13.1 → 3.13.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/Changelog.md +156 -128
- data/lib/rspec/mocks/any_instance/recorder.rb +2 -0
- data/lib/rspec/mocks/message_expectation.rb +32 -3
- data/lib/rspec/mocks/syntax.rb +1 -1
- data/lib/rspec/mocks/test_double.rb +3 -1
- data/lib/rspec/mocks/verifying_double.rb +2 -0
- data/lib/rspec/mocks/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +24 -89
- 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: 70aeeb12e29656230a9a1eb6a7d5021d7dce9d6bbb548436eddfb13743ac27cd
|
4
|
+
data.tar.gz: e902f36538ed12570a3b2f023f06b29731aa24c1304b3b3b1dc20467f36f9a86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5273cf8c51575510fb8481c2179b7681bb70bae00f9a014339fe96316ba19c91a39531adef23b066d06d461e25c4749d13813197cabece3130f26c22ce36a1e2
|
7
|
+
data.tar.gz: 69a316cce8b839cedd41441b18546a752b435c05930d197c3433be5506cdf42748a524031f7fc701610e4dfc21be1dc9ab9cb4a669df7d3032038281a24921e8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,5 +1,33 @@
|
|
1
1
|
### Development
|
2
|
-
[Full Changelog](
|
2
|
+
[Full Changelog](https://github.com/rspec/rspec/compare/rspec-mocks-v3.13.4...3-13-maintenance)
|
3
|
+
|
4
|
+
### 3.13.4 / 2025-05-05
|
5
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.13.3...v3.13.4)
|
6
|
+
|
7
|
+
Bug Fixes:
|
8
|
+
|
9
|
+
* Fix regression where nested stubbed method calls would inadvertently not be counted.
|
10
|
+
(Jon Rowe, rspec/rspec#214)
|
11
|
+
* Fix regression where keyword arguments would not be passed through to nested stubbed
|
12
|
+
method calls. (Jon Rowe, rspec/rspec#214)
|
13
|
+
|
14
|
+
### 3.13.3 / 2025-05-01
|
15
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.13.2...v3.13.3)
|
16
|
+
|
17
|
+
Bug Fixes:
|
18
|
+
|
19
|
+
* When stubbing methods using the `expect_any_instance_of` or `allow_any_instance_of`
|
20
|
+
ensure the stubbed method has the same visibility as the real method.
|
21
|
+
(Jon Rowe, rspec/rspec-mocks#1596)
|
22
|
+
* Prevent recursive calls to stubbed methods during stub invocation.
|
23
|
+
(James Dabbs, rspec/rspec#116, rspec/rspec#156)
|
24
|
+
|
25
|
+
### 3.13.2 / 2024-10-02
|
26
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.13.1...v3.13.2)
|
27
|
+
|
28
|
+
Bug Fixes:
|
29
|
+
|
30
|
+
* Support keyword arguments in callables passed to `and_invoke`. (Jon Rowe, rspec/rspec-mocks#1595)
|
3
31
|
|
4
32
|
### 3.13.1 / 2024-05-08
|
5
33
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.13.0...v3.13.1)
|
@@ -7,21 +35,21 @@
|
|
7
35
|
Bug Fixes:
|
8
36
|
|
9
37
|
* Use `RSpec::Support::Mutex` in `RSpec::Mocks::Proxy` to avoid issues from
|
10
|
-
stubbing `::Mutex#new`. (Eric Mueller, #1575)
|
38
|
+
stubbing `::Mutex#new`. (Eric Mueller, rspec/rspec-mocks#1575)
|
11
39
|
|
12
40
|
### 3.13.0 / 2024-02-04
|
13
41
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.7...v3.13.0)
|
14
42
|
|
15
43
|
Enhancements:
|
16
44
|
|
17
|
-
* Add an `array_excluding` matcher for arguments. (Zane Wolfgang Pickett, #1528)
|
45
|
+
* Add an `array_excluding` matcher for arguments. (Zane Wolfgang Pickett, rspec/rspec-mocks#1528)
|
18
46
|
|
19
47
|
### 3.12.7 / 2024-02-04
|
20
48
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.6...v3.12.7)
|
21
49
|
|
22
50
|
Bug Fixes:
|
23
51
|
|
24
|
-
* Reduce allocations from "any_instance" style mocks. (Carlos Palhares, #1479)
|
52
|
+
* Reduce allocations from "any_instance" style mocks. (Carlos Palhares, rspec/rspec-mocks#1479)
|
25
53
|
|
26
54
|
### 3.12.6 / 2023-07-11
|
27
55
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.5...v3.12.6)
|
@@ -29,7 +57,7 @@ Bug Fixes:
|
|
29
57
|
Bug Fixes:
|
30
58
|
|
31
59
|
* Fix an issue with `and_call_original` when using the `method_missing` fallback
|
32
|
-
with keyword arguments. (Igor Drozdov, #1552)
|
60
|
+
with keyword arguments. (Igor Drozdov, rspec/rspec-mocks#1552)
|
33
61
|
|
34
62
|
### 3.12.5 / 2023-03-30
|
35
63
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.4...v3.12.5)
|
@@ -37,16 +65,16 @@ Bug Fixes:
|
|
37
65
|
Bug Fixes:
|
38
66
|
|
39
67
|
* Fix compatibility issue with Rails where active_support monkey patches `with`
|
40
|
-
when using any instance. (Lachlan Sylvester, #1540)
|
68
|
+
when using any instance. (Lachlan Sylvester, rspec/rspec-mocks#1540)
|
41
69
|
|
42
70
|
### 3.12.4 / 2023-03-12
|
43
71
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.3...v3.12.4)
|
44
72
|
|
45
73
|
Bug Fixes:
|
46
74
|
|
47
|
-
* Fix an issue with asserting that Array#reverse is never called. (Brad Trick, #1533)
|
75
|
+
* Fix an issue with asserting that Array#reverse is never called. (Brad Trick, rspec/rspec-mocks#1533)
|
48
76
|
* Fix compatibility issue with Rails where active_support monkey patches `with`.
|
49
|
-
(Jean Boussier, #1531, #1534)
|
77
|
+
(Jean Boussier, rspec/rspec-mocks#1531, rspec/rspec-mocks#1534)
|
50
78
|
|
51
79
|
### 3.12.3 / 2023-01-17
|
52
80
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.2...v3.12.3)
|
@@ -54,7 +82,7 @@ Bug Fixes:
|
|
54
82
|
Bug Fixes:
|
55
83
|
|
56
84
|
* Fix keyword delegation in `send` for verifying doubles on Ruby 3.
|
57
|
-
(Charlie Honig, #1485)
|
85
|
+
(Charlie Honig, rspec/rspec-mocks#1485)
|
58
86
|
|
59
87
|
### 3.12.2 / 2023-01-07
|
60
88
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.1...v3.12.2)
|
@@ -62,24 +90,24 @@ Bug Fixes:
|
|
62
90
|
Bug Fixes:
|
63
91
|
|
64
92
|
* Fix implementation blocks for mocks using keyword arguments on Ruby 3.2.0.
|
65
|
-
(Adam Steel, #1508)
|
93
|
+
(Adam Steel, rspec/rspec-mocks#1508)
|
66
94
|
* Fix keyword argument assertions when mocking using `with` on Ruby 3.2.0.
|
67
|
-
(Slava Kardakov, Benoit Tigeot, Phil Pirozhkov, Benoit Daloze, #1514)
|
95
|
+
(Slava Kardakov, Benoit Tigeot, Phil Pirozhkov, Benoit Daloze, rspec/rspec-mocks#1514)
|
68
96
|
|
69
97
|
### 3.12.1 / 2022-12-10
|
70
98
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.0...v3.12.1)
|
71
99
|
|
72
100
|
Bug Fixes:
|
73
101
|
|
74
|
-
* Remove empty diff marker when a diff only contains console codes. (Jon Rowe, #1506)
|
75
|
-
* Show keyword vs hash diff marker when arguments are not `==` (Jon Rowe, #1506)
|
102
|
+
* Remove empty diff marker when a diff only contains console codes. (Jon Rowe, rspec/rspec-mocks#1506)
|
103
|
+
* Show keyword vs hash diff marker when arguments are not `==` (Jon Rowe, rspec/rspec-mocks#1506)
|
76
104
|
* Change check to detect frozen objects to rescue errors rather than
|
77
105
|
pre-empting by checking `frozen?` due to some objects mis-behaving.
|
78
|
-
(Keegan Roth, #1401)
|
106
|
+
(Keegan Roth, rspec/rspec-mocks#1401)
|
79
107
|
* Prevent unfulfilled expectations using `expect_any_instance_of` across a class
|
80
|
-
inheritance boundary from raising rather than failing. (Jon Rowe, #1496)
|
108
|
+
inheritance boundary from raising rather than failing. (Jon Rowe, rspec/rspec-mocks#1496)
|
81
109
|
* Prevent a misleading error message when using `allow(...).not_to` with
|
82
|
-
unsupported matchers. (Phil Pirozhkov, #1503)
|
110
|
+
unsupported matchers. (Phil Pirozhkov, rspec/rspec-mocks#1503)
|
83
111
|
|
84
112
|
### 3.12.0 / 2022-10-26
|
85
113
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.11.2...v3.12.0)
|
@@ -87,7 +115,7 @@ Bug Fixes:
|
|
87
115
|
Enhancements:
|
88
116
|
|
89
117
|
* Improve diff output when diffing keyword arguments against hashes.
|
90
|
-
(Jean Boussier, #1461)
|
118
|
+
(Jean Boussier, rspec/rspec-mocks#1461)
|
91
119
|
|
92
120
|
### 3.11.2 / 2022-10-25
|
93
121
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.11.1...v3.11.2)
|
@@ -96,9 +124,9 @@ Bug Fixes:
|
|
96
124
|
|
97
125
|
* Use the original implementation of `Class.new` to detect overridden definitions
|
98
126
|
of `new` rather than the owner, fixing detection of "double aliased" methods
|
99
|
-
in Ruby 3 and above. (Benoit Daloze, #1470, #1476)
|
127
|
+
in Ruby 3 and above. (Benoit Daloze, rspec/rspec-mocks#1470, rspec/rspec-mocks#1476)
|
100
128
|
* Support keyword argument semantics when constraining argument expectations using
|
101
|
-
`with` on Ruby 3.0+ with `instance_double` (Andrii Malyshko, #1473)
|
129
|
+
`with` on Ruby 3.0+ with `instance_double` (Andrii Malyshko, rspec/rspec-mocks#1473)
|
102
130
|
|
103
131
|
### 3.11.1 / 2022-03-31
|
104
132
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.11.0...v3.11.1)
|
@@ -107,7 +135,7 @@ Bug Fixes:
|
|
107
135
|
|
108
136
|
* Add extra `ruby2_keywords` calls to properly designate methods using
|
109
137
|
`*args` to pass keyword around, fixes an issue with TruffleRuby.
|
110
|
-
(Benoit Daloze, #1464)
|
138
|
+
(Benoit Daloze, rspec/rspec-mocks#1464)
|
111
139
|
|
112
140
|
### 3.11.0 / 2022-02-09
|
113
141
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.3...v3.11.0)
|
@@ -115,16 +143,16 @@ Bug Fixes:
|
|
115
143
|
Enhancements:
|
116
144
|
|
117
145
|
* Add `and_invoke` implementation for configuring responses to `receive`
|
118
|
-
(and `receive_messages`) with multiple callable objects. (Kyle Smith, #1411)
|
146
|
+
(and `receive_messages`) with multiple callable objects. (Kyle Smith, rspec/rspec-mocks#1411)
|
119
147
|
|
120
148
|
### 3.10.3 / 2022-01-28
|
121
149
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.2...v3.10.3)
|
122
150
|
|
123
151
|
Bug Fixes:
|
124
152
|
|
125
|
-
* Suppress warning by setting `$VERBOSE` to nil. (Nobuyoshi Nakada, #1414)
|
153
|
+
* Suppress warning by setting `$VERBOSE` to nil. (Nobuyoshi Nakada, rspec/rspec-mocks#1414)
|
126
154
|
* Support keyword argument semantics when constraining argument expectations using
|
127
|
-
`with` on Ruby 3.0+ (Yusuke Endoh, #1394)
|
155
|
+
`with` on Ruby 3.0+ (Yusuke Endoh, rspec/rspec-mocks#1394)
|
128
156
|
|
129
157
|
### 3.10.2 / 2021-01-27
|
130
158
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.1...v3.10.2)
|
@@ -132,12 +160,12 @@ Bug Fixes:
|
|
132
160
|
Bug Fixes:
|
133
161
|
|
134
162
|
* Support keyword arguments with `and_call_original` on Ruby 3.0.
|
135
|
-
(Bryan Powell, #1385)
|
163
|
+
(Bryan Powell, rspec/rspec-mocks#1385)
|
136
164
|
* `RSpec::Mocks::Constant#previously_defined?` is now always a boolean.
|
137
|
-
(Phil Pirozhkov, #1397)
|
165
|
+
(Phil Pirozhkov, rspec/rspec-mocks#1397)
|
138
166
|
* Support keyword arguments on Ruby 3.0 when used with `expect_any_instance_of`
|
139
167
|
or `allow_any_instance_of` with `and_call_original`.
|
140
|
-
(Jess Hottenstein, #1407)
|
168
|
+
(Jess Hottenstein, rspec/rspec-mocks#1407)
|
141
169
|
|
142
170
|
### 3.10.1 / 2020-12-27
|
143
171
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.0...v3.10.1)
|
@@ -145,7 +173,7 @@ Bug Fixes:
|
|
145
173
|
Bug Fixes:
|
146
174
|
|
147
175
|
* Issue `ArgumentError` rather than `TypeError` when unsupported methods on
|
148
|
-
unsupported objects are attempted to be stubbed. (@zhisme, #1357)
|
176
|
+
unsupported objects are attempted to be stubbed. (@zhisme, rspec/rspec-mocks#1357)
|
149
177
|
|
150
178
|
### 3.10.0 / 2020-10-30
|
151
179
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.9.1...v3.10.0)
|
@@ -153,9 +181,9 @@ Bug Fixes:
|
|
153
181
|
Enhancements:
|
154
182
|
* Add the ability to set a custom error generator in `MessageExpectation`.
|
155
183
|
This will allow rspec-expectations to inject a custom failure message.
|
156
|
-
(Benoit Tigeot and Nicolas Zermati, #1312)
|
184
|
+
(Benoit Tigeot and Nicolas Zermati, rspec/rspec-mocks#1312)
|
157
185
|
* Return the result of the block passed to `RSpec::Mocks.with_temporary_scope`
|
158
|
-
when block run. (@expeehaa, #1329)
|
186
|
+
when block run. (@expeehaa, rspec/rspec-mocks#1329)
|
159
187
|
|
160
188
|
### 3.9.1 / 2019-12-31
|
161
189
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.9.0...v3.9.1)
|
@@ -163,7 +191,7 @@ Enhancements:
|
|
163
191
|
Bug Fixes:
|
164
192
|
|
165
193
|
* Trigger `RSpec::Mocks.configuration.verifying_double_callbacks` when using
|
166
|
-
`allow_any_instance_of` or `expect_any_instance_of` (Daniel Orner, #1309)
|
194
|
+
`allow_any_instance_of` or `expect_any_instance_of` (Daniel Orner, rspec/rspec-mocks#1309)
|
167
195
|
|
168
196
|
### 3.9.0 / 2019-10-07
|
169
197
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.8.2...v3.9.0)
|
@@ -171,16 +199,16 @@ Bug Fixes:
|
|
171
199
|
Enhancements:
|
172
200
|
|
173
201
|
* Improve thread safety of message expectations by using Mutex to prevent
|
174
|
-
deadlocking errors. (Ry Biesemeyer, #1236)
|
202
|
+
deadlocking errors. (Ry Biesemeyer, rspec/rspec-mocks#1236)
|
175
203
|
* Add the ability to use `time` as an alias for `times`. For example:
|
176
204
|
`expect(Class).to receive(:method).exactly(1).time`.
|
177
|
-
(Pistos, Benoit Tigeot, #1271)
|
205
|
+
(Pistos, Benoit Tigeot, rspec/rspec-mocks#1271)
|
178
206
|
|
179
207
|
### 3.8.2 / 2019-10-02
|
180
208
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.8.1...v3.8.2)
|
181
209
|
|
182
210
|
* Allow `array_including` argument matchers to be nested.
|
183
|
-
(Emmanuel Delmas, #1291)
|
211
|
+
(Emmanuel Delmas, rspec/rspec-mocks#1291)
|
184
212
|
|
185
213
|
### 3.8.1 / 2019-06-13
|
186
214
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.8.0...v3.8.1)
|
@@ -188,7 +216,7 @@ Enhancements:
|
|
188
216
|
Bug Fixes:
|
189
217
|
|
190
218
|
* Ensure stubbing methods does not change their visibility.
|
191
|
-
(Kevin Boschert, #1277)
|
219
|
+
(Kevin Boschert, rspec/rspec-mocks#1277)
|
192
220
|
|
193
221
|
### 3.8.0 / 2018-08-04
|
194
222
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.7.0...v3.8.0)
|
@@ -196,12 +224,12 @@ Bug Fixes:
|
|
196
224
|
Bug Fixes:
|
197
225
|
|
198
226
|
* Issue error when encountering invalid "counted" negative message expectations.
|
199
|
-
(Sergiy Yarinovskiy, #1212)
|
227
|
+
(Sergiy Yarinovskiy, rspec/rspec-mocks#1212)
|
200
228
|
* Ensure `allow_any_instance_of` and `expect_any_instance_of` can be temporarily
|
201
|
-
supressed. (Jon Rowe, #1228)
|
229
|
+
supressed. (Jon Rowe, rspec/rspec-mocks#1228)
|
202
230
|
* Ensure `expect_any_instance_of(double).to_not have_received(:some_method)`
|
203
231
|
fails gracefully (as its not supported) rather than issuing a `NoMethodError`.
|
204
|
-
(Maxim Krizhanovsky, #1231)
|
232
|
+
(Maxim Krizhanovsky, rspec/rspec-mocks#1231)
|
205
233
|
|
206
234
|
### 3.7.0 / 2017-10-17
|
207
235
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.6.0...v3.7.0)
|
@@ -209,12 +237,12 @@ Bug Fixes:
|
|
209
237
|
Enhancements:
|
210
238
|
|
211
239
|
* Improve compatibility with `--enable-frozen-string-literal` option
|
212
|
-
on Ruby 2.3+. (Pat Allan, #1165)
|
240
|
+
on Ruby 2.3+. (Pat Allan, rspec/rspec-mocks#1165)
|
213
241
|
|
214
242
|
Bug Fixes:
|
215
243
|
|
216
244
|
* Fix `hash_including` and `hash_excluding` so that they work against
|
217
|
-
subclasses of `Hash`. (Aaron Rosenberg, #1167)
|
245
|
+
subclasses of `Hash`. (Aaron Rosenberg, rspec/rspec-mocks#1167)
|
218
246
|
|
219
247
|
### 3.6.0 / 2017-05-04
|
220
248
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.6.0.beta2...v3.6.0)
|
@@ -222,11 +250,11 @@ Bug Fixes:
|
|
222
250
|
Bug Fixes:
|
223
251
|
|
224
252
|
* Fix "instance variable @color not initialized" warning when using
|
225
|
-
rspec-mocks without rspec-core. (Myron Marston, #1142)
|
253
|
+
rspec-mocks without rspec-core. (Myron Marston, rspec/rspec-mocks#1142)
|
226
254
|
* Restore aliased module methods properly when stubbing on 1.8.7.
|
227
|
-
(Samuel Giddins, #1144)
|
255
|
+
(Samuel Giddins, rspec/rspec-mocks#1144)
|
228
256
|
* Allow a message chain expectation to be constrained by argument(s).
|
229
|
-
(Jon Rowe, #1156)
|
257
|
+
(Jon Rowe, rspec/rspec-mocks#1156)
|
230
258
|
|
231
259
|
### 3.6.0.beta2 / 2016-12-12
|
232
260
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.6.0.beta1...v3.6.0.beta2)
|
@@ -235,16 +263,16 @@ Enhancements:
|
|
235
263
|
|
236
264
|
* Add new `without_partial_double_verification { }` API that lets you
|
237
265
|
temporarily turn off partial double verification for an example.
|
238
|
-
(Jon Rowe, #1104)
|
266
|
+
(Jon Rowe, rspec/rspec-mocks#1104)
|
239
267
|
|
240
268
|
### 3.6.0.beta1 / 2016-10-09
|
241
269
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0...v3.6.0.beta1)
|
242
270
|
|
243
271
|
Bug Fixes:
|
244
272
|
|
245
|
-
* Return the test double instance form `#freeze` (Alessandro Berardi, #1109)
|
273
|
+
* Return the test double instance form `#freeze` (Alessandro Berardi, rspec/rspec-mocks#1109)
|
246
274
|
* Allow the special logic for stubbing `new` to work when `<Class>.method` has
|
247
|
-
been redefined. (Proby, #1119)
|
275
|
+
been redefined. (Proby, rspec/rspec-mocks#1119)
|
248
276
|
|
249
277
|
### 3.5.0 / 2016-07-01
|
250
278
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0.beta4...v3.5.0)
|
@@ -252,14 +280,14 @@ Bug Fixes:
|
|
252
280
|
Enhancements:
|
253
281
|
|
254
282
|
* Provides a nice string representation of
|
255
|
-
`RSpec::Mocks::MessageExpectation` (Myron Marston, #1095)
|
283
|
+
`RSpec::Mocks::MessageExpectation` (Myron Marston, rspec/rspec-mocks#1095)
|
256
284
|
|
257
285
|
### 3.5.0.beta4 / 2016-06-05
|
258
286
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0.beta3...v3.5.0.beta4)
|
259
287
|
|
260
288
|
Enhancements:
|
261
289
|
|
262
|
-
* Add `and_throw` to any instance handling. (Tobias Bühlmann, #1068)
|
290
|
+
* Add `and_throw` to any instance handling. (Tobias Bühlmann, rspec/rspec-mocks#1068)
|
263
291
|
|
264
292
|
### 3.5.0.beta3 / 2016-04-02
|
265
293
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0.beta2...v3.5.0.beta3)
|
@@ -267,9 +295,9 @@ Enhancements:
|
|
267
295
|
Enhancements:
|
268
296
|
|
269
297
|
* Issue warning when attempting to use unsupported
|
270
|
-
`allow(...).to receive(...).ordered`. (Jon Rowe, #1000)
|
298
|
+
`allow(...).to receive(...).ordered`. (Jon Rowe, rspec/rspec-mocks#1000)
|
271
299
|
* Add `rspec/mocks/minitest_integration`, to properly integrate rspec-mocks
|
272
|
-
with minitest. (Myron Marston, #1065)
|
300
|
+
with minitest. (Myron Marston, rspec/rspec-mocks#1065)
|
273
301
|
|
274
302
|
### 3.5.0.beta2 / 2016-03-10
|
275
303
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0.beta1...v3.5.0.beta2)
|
@@ -277,12 +305,12 @@ Enhancements:
|
|
277
305
|
Enhancements:
|
278
306
|
|
279
307
|
* Improve error message displayed when using `and_wrap_original` on pure test
|
280
|
-
doubles. (betesh, #1063)
|
308
|
+
doubles. (betesh, rspec/rspec-mocks#1063)
|
281
309
|
|
282
310
|
Bug Fixes:
|
283
311
|
|
284
312
|
* Fix issue that prevented `receive_message_chain(...).with(...)` working
|
285
|
-
correctly on "any instance" mocks. (Jon Rowe, #1061)
|
313
|
+
correctly on "any instance" mocks. (Jon Rowe, rspec/rspec-mocks#1061)
|
286
314
|
|
287
315
|
### 3.5.0.beta1 / 2016-02-06
|
288
316
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.4.1...v3.5.0.beta1)
|
@@ -290,20 +318,20 @@ Bug Fixes:
|
|
290
318
|
Bug Fixes:
|
291
319
|
|
292
320
|
* Allow `any_instance_of(...).to receive(...)` to use `and_yield` multiple
|
293
|
-
times. (Kilian Cirera Sant, #1054)
|
321
|
+
times. (Kilian Cirera Sant, rspec/rspec-mocks#1054)
|
294
322
|
* Allow matchers which inherit from `rspec-mocks` matchers to be used for
|
295
|
-
`allow`. (Andrew Kozin, #1056)
|
323
|
+
`allow`. (Andrew Kozin, rspec/rspec-mocks#1056)
|
296
324
|
* Prevent stubbing `respond_to?` on partial doubles from causing infinite
|
297
|
-
recursion. (Jon Rowe, #1013)
|
325
|
+
recursion. (Jon Rowe, rspec/rspec-mocks#1013)
|
298
326
|
* Prevent aliased methods from disapearing after being mocked with
|
299
|
-
`any_instance` (regression from #1043). (Joe Rafaniello, #1060)
|
327
|
+
`any_instance` (regression from rspec/rspec-mocks#1043). (Joe Rafaniello, rspec/rspec-mocks#1060)
|
300
328
|
|
301
329
|
### 3.4.1 / 2016-01-10
|
302
330
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.4.0...v3.4.1)
|
303
331
|
|
304
332
|
Bug Fixes:
|
305
333
|
|
306
|
-
* Fix `any_instance` to work properly on Ruby 2.3. (Joe Rafaniello, #1043)
|
334
|
+
* Fix `any_instance` to work properly on Ruby 2.3. (Joe Rafaniello, rspec/rspec-mocks#1043)
|
307
335
|
|
308
336
|
### 3.4.0 / 2015-11-11
|
309
337
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.3.2...v3.4.0)
|
@@ -311,18 +339,18 @@ Bug Fixes:
|
|
311
339
|
Enhancements:
|
312
340
|
|
313
341
|
* Make `expect(...).to have_received` work without relying upon
|
314
|
-
rspec-expectations. (Myron Marston, #978)
|
342
|
+
rspec-expectations. (Myron Marston, rspec/rspec-mocks#978)
|
315
343
|
* Add option for failing tests when expectations are set on `nil`.
|
316
|
-
(Liz Rush, #983)
|
344
|
+
(Liz Rush, rspec/rspec-mocks#983)
|
317
345
|
|
318
346
|
Bug Fixes:
|
319
347
|
|
320
348
|
* Fix `have_received { ... }` so that any block passed when the message
|
321
|
-
was received is forwarded to the `have_received` block. (Myron Marston, #1006)
|
349
|
+
was received is forwarded to the `have_received` block. (Myron Marston, rspec/rspec-mocks#1006)
|
322
350
|
* Fix infinite loop in error generator when stubbing `respond_to?`.
|
323
|
-
(Alex Dowad, #1022)
|
351
|
+
(Alex Dowad, rspec/rspec-mocks#1022)
|
324
352
|
* Fix issue with using `receive` on subclasses (at a class level) with 1.8.7.
|
325
|
-
(Alex Dowad, #1026)
|
353
|
+
(Alex Dowad, rspec/rspec-mocks#1026)
|
326
354
|
|
327
355
|
### 3.3.2 / 2015-07-15
|
328
356
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.3.1...v3.3.2)
|
@@ -330,7 +358,7 @@ Bug Fixes:
|
|
330
358
|
Bug Fixes:
|
331
359
|
|
332
360
|
* Prevent thread deadlock errors during proxy creation (e.g. when using
|
333
|
-
`before_verifying_doubles` callbacks). (Jon Rowe, #980, #979)
|
361
|
+
`before_verifying_doubles` callbacks). (Jon Rowe, rspec/rspec-mocks#980, rspec/rspec-mocks#979)
|
334
362
|
|
335
363
|
### 3.3.1 / 2015-06-19
|
336
364
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.3.0...v3.3.1)
|
@@ -340,7 +368,7 @@ Bug Fixes:
|
|
340
368
|
* Fix bug in `before_verifying_double` callback logic that caused it to be called
|
341
369
|
once for each class in the ancestor list when mocking or stubbing a class. Now
|
342
370
|
it is only called for the mocked or stubbed class, as you would expect. (Sam
|
343
|
-
Phippen, #974)
|
371
|
+
Phippen, rspec/rspec-mocks#974)
|
344
372
|
|
345
373
|
### 3.3.0 / 2015-06-12
|
346
374
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.2.1...v3.3.0)
|
@@ -349,45 +377,45 @@ Enhancements:
|
|
349
377
|
|
350
378
|
* When stubbing `new` on `MyClass` or `class_double(MyClass)`, use the
|
351
379
|
method signature from `MyClass#initialize` to verify arguments.
|
352
|
-
(Myron Marston, #886)
|
380
|
+
(Myron Marston, rspec/rspec-mocks#886)
|
353
381
|
* Use matcher descriptions when generating description of received arguments
|
354
|
-
for mock expectation failures. (Tim Wade, #891)
|
355
|
-
* Avoid loading `stringio` unnecessarily. (Myron Marston, #894)
|
382
|
+
for mock expectation failures. (Tim Wade, rspec/rspec-mocks#891)
|
383
|
+
* Avoid loading `stringio` unnecessarily. (Myron Marston, rspec/rspec-mocks#894)
|
356
384
|
* Verifying doubles failure messages now distinguish between class and instance
|
357
|
-
level methods. (Tim Wade, #896, #908)
|
385
|
+
level methods. (Tim Wade, rspec/rspec-mocks#896, rspec/rspec-mocks#908)
|
358
386
|
* Improve mock expectation failure messages so that it combines both
|
359
|
-
number of times and the received arguments in the output. (John Ceh, #918)
|
387
|
+
number of times and the received arguments in the output. (John Ceh, rspec/rspec-mocks#918)
|
360
388
|
* Improve how test doubles are represented in failure messages.
|
361
|
-
(Siva Gollapalli, Myron Marston, #932)
|
389
|
+
(Siva Gollapalli, Myron Marston, rspec/rspec-mocks#932)
|
362
390
|
* Rename `RSpec::Mocks::Configuration#when_declaring_verifying_double` to
|
363
391
|
`RSpec::Mocks::Configuration#before_verifying_doubles` and utilise when
|
364
|
-
verifying partial doubles. (Jon Rowe, #940)
|
392
|
+
verifying partial doubles. (Jon Rowe, rspec/rspec-mocks#940)
|
365
393
|
* Use rspec-support's `ObjectFormatter` for improved formatting of
|
366
394
|
arguments in failure messages so that, for example, full time
|
367
|
-
precisions is displayed for time objects. (Gavin Miller, Myron Marston, #955)
|
395
|
+
precisions is displayed for time objects. (Gavin Miller, Myron Marston, rspec/rspec-mocks#955)
|
368
396
|
|
369
397
|
Bug Fixes:
|
370
398
|
|
371
399
|
* Ensure expectations that raise eagerly also raise during RSpec verification.
|
372
400
|
This means that if exceptions are caught inside test execution the test will
|
373
|
-
still fail. (Sam Phippen, #884)
|
401
|
+
still fail. (Sam Phippen, rspec/rspec-mocks#884)
|
374
402
|
* Fix `have_received(msg).with(args).exactly(n).times` and
|
375
403
|
`receive(msg).with(args).exactly(n).times` failure messages
|
376
404
|
for when the message was received the wrong number of times with
|
377
405
|
the specified args, and also received additional times with other
|
378
406
|
arguments. Previously it confusingly listed the arguments as being
|
379
407
|
mis-matched (even when the double was allowed to receive with any
|
380
|
-
args) rather than listing the count. (John Ceh, #918)
|
408
|
+
args) rather than listing the count. (John Ceh, rspec/rspec-mocks#918)
|
381
409
|
* Fix `any_args`/`anything` support so that we avoid calling `obj == anything`
|
382
410
|
on user objects that may have improperly implemented `==` in a way that
|
383
|
-
raises errors. (Myron Marston, #924)
|
411
|
+
raises errors. (Myron Marston, rspec/rspec-mocks#924)
|
384
412
|
* Fix edge case involving stubbing the same method on a class and a subclass
|
385
|
-
which previously hit a `NoMethodError` internally in RSpec. (Myron Marston #954)
|
413
|
+
which previously hit a `NoMethodError` internally in RSpec. (Myron Marston rspec/rspec-mocks#954)
|
386
414
|
* Fix edge case where the message received count would be incremented multiple
|
387
|
-
times for one failure. (Myron Marston, #957)
|
415
|
+
times for one failure. (Myron Marston, rspec/rspec-mocks#957)
|
388
416
|
* Fix failure messages for when spies received the expected message with
|
389
|
-
different arguments and also received another message. (Maurício Linhares, #960)
|
390
|
-
* Silence whitespace-only diffs. (Myron Marston, #969)
|
417
|
+
different arguments and also received another message. (Maurício Linhares, rspec/rspec-mocks#960)
|
418
|
+
* Silence whitespace-only diffs. (Myron Marston, rspec/rspec-mocks#969)
|
391
419
|
|
392
420
|
### 3.2.1 / 2015-02-23
|
393
421
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.2.0...v3.2.1)
|
@@ -396,11 +424,11 @@ Bug Fixes:
|
|
396
424
|
|
397
425
|
* Add missing `rspec/support/differ` require so that rspec-mocks can be
|
398
426
|
used w/o rspec-expectations (which also loads the differ and hided the
|
399
|
-
fact we forgot to require it). (Myron Marston, #893)
|
427
|
+
fact we forgot to require it). (Myron Marston, rspec/rspec-mocks#893)
|
400
428
|
* Revert tracking of received arg mutation (added in 3.2.0 to provide an
|
401
429
|
error in a situation we can't support) as our implementation has side
|
402
430
|
effects on non-standard objects and there's no solution we could come
|
403
|
-
up with that always works. (Myron Marston, #900)
|
431
|
+
up with that always works. (Myron Marston, rspec/rspec-mocks#900)
|
404
432
|
|
405
433
|
### 3.2.0 / 2015-02-03
|
406
434
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.1.3...v3.2.0)
|
@@ -408,55 +436,55 @@ Bug Fixes:
|
|
408
436
|
Enhancements:
|
409
437
|
|
410
438
|
* Treat `any_args` as an arg splat, allowing it to match an arbitrary
|
411
|
-
number of args at any point in an arg list. (Myron Marston, #786)
|
439
|
+
number of args at any point in an arg list. (Myron Marston, rspec/rspec-mocks#786)
|
412
440
|
* Print diffs when arguments in mock expectations are mismatched.
|
413
|
-
(Sam Phippen, #751)
|
441
|
+
(Sam Phippen, rspec/rspec-mocks#751)
|
414
442
|
* Support names for verified doubles (`instance_double`, `instance_spy`,
|
415
443
|
`class_double`, `class_spy`, `object_double`, `object_spy`). (Cezary
|
416
|
-
Baginski, #826)
|
444
|
+
Baginski, rspec/rspec-mocks#826)
|
417
445
|
* Make `array_including` and `hash_including` argument matchers composable.
|
418
|
-
(Sam Phippen, #819)
|
446
|
+
(Sam Phippen, rspec/rspec-mocks#819)
|
419
447
|
* Make `allow_any_instance_of(...).to receive(...).and_wrap_original`
|
420
|
-
work. (Ryan Fitzgerald, #869)
|
448
|
+
work. (Ryan Fitzgerald, rspec/rspec-mocks#869)
|
421
449
|
|
422
450
|
Bug Fixes:
|
423
451
|
|
424
452
|
* Provide a clear error when users wrongly combine `no_args` with
|
425
453
|
additional arguments (e.g. `expect().to receive().with(no_args, 1)`).
|
426
|
-
(Myron Marston, #786)
|
454
|
+
(Myron Marston, rspec/rspec-mocks#786)
|
427
455
|
* Provide a clear error when users wrongly use `any_args` multiple times in the
|
428
456
|
same argument list (e.g. `expect().to receive().with(any_args, 1, any_args)`.
|
429
|
-
(Myron Marston, #786)
|
457
|
+
(Myron Marston, rspec/rspec-mocks#786)
|
430
458
|
* Prevent the error generator from using user object #description methods.
|
431
|
-
See [#685](https://github.com/rspec/rspec-mocks/issues/685).
|
432
|
-
(Sam Phippen, #751)
|
459
|
+
See [rspec/rspec-mocks#685](https://github.com/rspec/rspec-mocks/issues/685).
|
460
|
+
(Sam Phippen, rspec/rspec-mocks#751)
|
433
461
|
* Make verified doubles declared as `(instance|class)_double(SomeConst)`
|
434
462
|
work properly when `SomeConst` has previously been stubbed.
|
435
463
|
`(instance|class)_double("SomeClass")` already worked properly.
|
436
|
-
(Myron Marston, #824)
|
464
|
+
(Myron Marston, rspec/rspec-mocks#824)
|
437
465
|
* Add a matcher description for `receive`, `receive_messages` and
|
438
|
-
`receive_message_chain`. (Myron Marston, #828)
|
466
|
+
`receive_message_chain`. (Myron Marston, rspec/rspec-mocks#828)
|
439
467
|
* Validate invocation args for null object verified doubles.
|
440
|
-
(Myron Marston, #829)
|
468
|
+
(Myron Marston, rspec/rspec-mocks#829)
|
441
469
|
* Fix `RSpec::Mocks::Constant.original` when called with an invalid
|
442
470
|
constant to return an object indicating the constant name is invalid,
|
443
|
-
rather than blowing up. (Myron Marston, #833)
|
471
|
+
rather than blowing up. (Myron Marston, rspec/rspec-mocks#833)
|
444
472
|
* Make `extend RSpec::Mocks::ExampleMethods` on any object work properly
|
445
473
|
to add the rspec-mocks API to that object. Previously, `expect` would
|
446
|
-
be undefined. (Myron Marston, #846)
|
474
|
+
be undefined. (Myron Marston, rspec/rspec-mocks#846)
|
447
475
|
* Fix `require 'rspec/mocks/standalone'` so that it only affects `main`
|
448
476
|
and not every object. It's really only intended to be used in a REPL
|
449
477
|
like IRB, but some gems have loaded it, thinking it needs to be loaded
|
450
478
|
when using rspec-mocks outside the context of rspec-core.
|
451
|
-
(Myron Marston, #846)
|
479
|
+
(Myron Marston, rspec/rspec-mocks#846)
|
452
480
|
* Prevent message expectations from being modified by customization methods
|
453
|
-
(e.g. `with`) after they have been invoked. (Sam Phippen and Melanie Gilman, #837)
|
481
|
+
(e.g. `with`) after they have been invoked. (Sam Phippen and Melanie Gilman, rspec/rspec-mocks#837)
|
454
482
|
* Handle cases where a method stub cannot be removed due to something
|
455
483
|
external to RSpec monkeying with the method definition. This can
|
456
484
|
happen, for example, when you `file.reopen(io)` after previously
|
457
|
-
stubbing a method on the `file` object. (Myron Marston, #853)
|
485
|
+
stubbing a method on the `file` object. (Myron Marston, rspec/rspec-mocks#853)
|
458
486
|
* Provide a clear error when received message args are mutated before
|
459
|
-
a `have_received(...).with(...)` expectation. (Myron Marston, #868)
|
487
|
+
a `have_received(...).with(...)` expectation. (Myron Marston, rspec/rspec-mocks#868)
|
460
488
|
|
461
489
|
### 3.1.3 / 2014-10-08
|
462
490
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.1.2...v3.1.3)
|
@@ -464,13 +492,13 @@ Bug Fixes:
|
|
464
492
|
Bug Fixes:
|
465
493
|
|
466
494
|
* Correct received messages count when used with `have_received` matcher.
|
467
|
-
(Jon Rowe, #793)
|
495
|
+
(Jon Rowe, rspec/rspec-mocks#793)
|
468
496
|
* Provide a clear error message when you use `allow_any_instance_of(...)` or
|
469
497
|
`expect_any_instance_of(...)` with the `have_received` matcher (they are
|
470
498
|
not intended to be used together and previously caused an odd internal
|
471
|
-
failure in rspec-mocks). (Jon Rowe, #799).
|
499
|
+
failure in rspec-mocks). (Jon Rowe, rspec/rspec-mocks#799).
|
472
500
|
* Fix verified double `with` verification so that it applies to method
|
473
|
-
stubs. (Myron Marston, #790)
|
501
|
+
stubs. (Myron Marston, rspec/rspec-mocks#790)
|
474
502
|
|
475
503
|
### 3.1.2 / 2014-09-26
|
476
504
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.1.1...v3.1.2)
|
@@ -479,7 +507,7 @@ Bug Fixes:
|
|
479
507
|
|
480
508
|
* Provide a clear error message when you use `allow(...)` with the
|
481
509
|
`have_received` matcher (they are not intended to be used together
|
482
|
-
and previously caused an odd internal failure in rspec-mocks). (Jon Rowe, #788).
|
510
|
+
and previously caused an odd internal failure in rspec-mocks). (Jon Rowe, rspec/rspec-mocks#788).
|
483
511
|
|
484
512
|
### 3.1.1 / 2014-09-18
|
485
513
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.1.0...v3.1.1)
|
@@ -487,7 +515,7 @@ Bug Fixes:
|
|
487
515
|
Bug Fixes:
|
488
516
|
|
489
517
|
* Prevent included modules being detected as prepended modules on Ruby 2.0
|
490
|
-
when using `any_instance_of(...)`. (Tony Novak, #781)
|
518
|
+
when using `any_instance_of(...)`. (Tony Novak, rspec/rspec-mocks#781)
|
491
519
|
|
492
520
|
### 3.1.0 / 2014-09-04
|
493
521
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.0.4...v3.1.0)
|
@@ -496,24 +524,24 @@ Enhancements:
|
|
496
524
|
|
497
525
|
* Add spying methods (`spy`, `ìnstance_spy`, `class_spy` and `object_spy`)
|
498
526
|
which create doubles as null objects for use with spying in testing. (Sam
|
499
|
-
Phippen, #671)
|
527
|
+
Phippen, rspec/rspec-mocks#671)
|
500
528
|
* `have_received` matcher will raise "does not implement" errors correctly when
|
501
|
-
used with verifying doubles and partial doubles. (Xavier Shay, #722)
|
529
|
+
used with verifying doubles and partial doubles. (Xavier Shay, rspec/rspec-mocks#722)
|
502
530
|
* Allow matchers to be used in place of keyword arguments in `with`
|
503
|
-
expectations. (Xavier Shay, #726)
|
531
|
+
expectations. (Xavier Shay, rspec/rspec-mocks#726)
|
504
532
|
* Add `thrice` modifier to message expectation interface as a synonym
|
505
|
-
for `exactly(3).times`. (Dennis Taylor, #753)
|
533
|
+
for `exactly(3).times`. (Dennis Taylor, rspec/rspec-mocks#753)
|
506
534
|
* Add more `thrice` synonyms e.g. `.at_least(:thrice)`, `.at_most(:thrice)`,
|
507
|
-
`receive(...).thrice` and `have_received(...).thrice`. (Jon Rowe, #754)
|
535
|
+
`receive(...).thrice` and `have_received(...).thrice`. (Jon Rowe, rspec/rspec-mocks#754)
|
508
536
|
* Add `and_wrap_original` modifier for partial doubles to mutate the
|
509
|
-
response from a method. (Jon Rowe, #762)
|
537
|
+
response from a method. (Jon Rowe, rspec/rspec-mocks#762)
|
510
538
|
|
511
539
|
Bug Fixes:
|
512
540
|
|
513
541
|
* Remove `any_number_of_times` from `any_instance` recorders that were
|
514
|
-
erroneously causing mention of the method in documentation. (Jon Rowe, #760)
|
542
|
+
erroneously causing mention of the method in documentation. (Jon Rowe, rspec/rspec-mocks#760)
|
515
543
|
* Prevent included modules being detected as prepended modules on Ruby 2.0.
|
516
|
-
(Eugene Kenny, #771)
|
544
|
+
(Eugene Kenny, rspec/rspec-mocks#771)
|
517
545
|
|
518
546
|
### 3.0.4 / 2014-08-14
|
519
547
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.0.3...v3.0.4)
|
@@ -521,7 +549,7 @@ Bug Fixes:
|
|
521
549
|
Bug Fixes:
|
522
550
|
|
523
551
|
* Restore `kind_of(x)` to match using `arg.kind_of?(x)` (like RSpec 2)
|
524
|
-
rather than `x === arg`. (Jon Rowe, #750)
|
552
|
+
rather than `x === arg`. (Jon Rowe, rspec/rspec-mocks#750)
|
525
553
|
|
526
554
|
### 3.0.3 / 2014-07-21
|
527
555
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.0.2...v3.0.3)
|
@@ -529,10 +557,10 @@ Bug Fixes:
|
|
529
557
|
Bug Fixes:
|
530
558
|
|
531
559
|
* `have_received` matcher will raise "does not implement" errors correctly when
|
532
|
-
used with verifying doubles and partial doubles. (Xavier Shay, #722)
|
560
|
+
used with verifying doubles and partial doubles. (Xavier Shay, rspec/rspec-mocks#722)
|
533
561
|
* Make `double.as_null_object.dup` and `double.as_null_object.clone`
|
534
|
-
make the copies be null objects. (Myron Marston, #732)
|
535
|
-
* Don't inadvertently define `BasicObject` in 1.8.7. (Chris Griego, #739)
|
562
|
+
make the copies be null objects. (Myron Marston, rspec/rspec-mocks#732)
|
563
|
+
* Don't inadvertently define `BasicObject` in 1.8.7. (Chris Griego, rspec/rspec-mocks#739)
|
536
564
|
|
537
565
|
### 3.0.2 / 2014-06-19
|
538
566
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.0.1...v3.0.2)
|
@@ -540,11 +568,11 @@ Bug Fixes:
|
|
540
568
|
Bug Fixes:
|
541
569
|
|
542
570
|
* Fix edge case that triggered "can't add a new key into hash during
|
543
|
-
iteration" during mock verification. (Sam Phippen, Myron Marston, #711)
|
571
|
+
iteration" during mock verification. (Sam Phippen, Myron Marston, rspec/rspec-mocks#711)
|
544
572
|
* Fix verifying doubles so that when they accidentally leak into another
|
545
573
|
example, they provide the same clear error message that normal doubles
|
546
|
-
do. (Myron Marston, #718)
|
547
|
-
* Make `ordered` work with exact receive counts. (Sam Phippen, #713)
|
574
|
+
do. (Myron Marston, rspec/rspec-mocks#718)
|
575
|
+
* Make `ordered` work with exact receive counts. (Sam Phippen, rspec/rspec-mocks#713)
|
548
576
|
|
549
577
|
### 3.0.1 / 2014-06-07
|
550
578
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.0.0...v3.0.1)
|
@@ -552,10 +580,10 @@ Bug Fixes:
|
|
552
580
|
Bug Fixes:
|
553
581
|
|
554
582
|
* Fix `receive_message_chain(...)` so that it supports `with` just like
|
555
|
-
`stub_chain` did. (Jon Rowe, #697)
|
583
|
+
`stub_chain` did. (Jon Rowe, rspec/rspec-mocks#697)
|
556
584
|
* Fix regression in `expect_any_instance_of` so that it expects the
|
557
585
|
message on _any_ instance rather than on _every_ instance.
|
558
|
-
(Myron Marston, #699)
|
586
|
+
(Myron Marston, rspec/rspec-mocks#699)
|
559
587
|
|
560
588
|
### 3.0.0 / 2014-06-01
|
561
589
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.0.0.rc1...v3.0.0)
|
@@ -768,14 +796,14 @@ Bug Fixes:
|
|
768
796
|
|
769
797
|
Bug Fixes:
|
770
798
|
|
771
|
-
* Add missing deprecation for using `with` with no arguments e.g. `with()`. (Yousuke, #970)
|
799
|
+
* Add missing deprecation for using `with` with no arguments e.g. `with()`. (Yousuke, rspec/rspec-mocks#970)
|
772
800
|
|
773
801
|
### 2.99.3 / 2015-01-09
|
774
802
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.99.2...v2.99.3)
|
775
803
|
|
776
804
|
Bug Fixes:
|
777
805
|
|
778
|
-
* Fix regression that caused an error when a test double was deserialized from YAML. (Yuji Nakayama, #777)
|
806
|
+
* Fix regression that caused an error when a test double was deserialized from YAML. (Yuji Nakayama, rspec/rspec-mocks#777)
|
779
807
|
|
780
808
|
### 2.99.2 / 2014-07-21
|
781
809
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.99.1...v2.99.2)
|
@@ -783,7 +811,7 @@ Bug Fixes:
|
|
783
811
|
Enhancements:
|
784
812
|
|
785
813
|
* Warn about upcoming change to `#===` matching and `DateTime#===` behaviour.
|
786
|
-
(Jon Rowe, #735)
|
814
|
+
(Jon Rowe, rspec/rspec-mocks#735)
|
787
815
|
|
788
816
|
### 2.99.1 / 2014-06-12
|
789
817
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.99.0...v2.99.1)
|
@@ -791,11 +819,11 @@ Enhancements:
|
|
791
819
|
Bug Fixes:
|
792
820
|
|
793
821
|
* Fix bug that caused errors at the end of each example
|
794
|
-
when a `double.as_null_object` had been frozen. (Yuji Nakayama, #698)
|
822
|
+
when a `double.as_null_object` had been frozen. (Yuji Nakayama, rspec/rspec-mocks#698)
|
795
823
|
|
796
824
|
Deprecations:
|
797
825
|
|
798
|
-
* Deprecate freezing a test double. (Yuji Nakayama, #698)
|
826
|
+
* Deprecate freezing a test double. (Yuji Nakayama, rspec/rspec-mocks#698)
|
799
827
|
|
800
828
|
### 2.99.0 / 2014-06-01
|
801
829
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.99.0.rc1...v2.99.0)
|
@@ -971,8 +999,8 @@ Bug fixes
|
|
971
999
|
* Fix `Marshal.dump` extension so that it correctly handles nil.
|
972
1000
|
(Luke Imhoff, Jon Rowe)
|
973
1001
|
* Fix isolation of `allow_message_expectations_on_nil` (Jon Rowe)
|
974
|
-
* Use inspect to format actual arguments on expectations in failure messages (#280, Ben Langfeld)
|
975
|
-
* Protect against improperly initialised test doubles (#293) (Joseph Shraibman and Jon Rowe)
|
1002
|
+
* Use inspect to format actual arguments on expectations in failure messages (rspec/rspec-mocks#280, Ben Langfeld)
|
1003
|
+
* Protect against improperly initialised test doubles (rspec/rspec-mocks#293) (Joseph Shraibman and Jon Rowe)
|
976
1004
|
|
977
1005
|
Deprecations
|
978
1006
|
|
@@ -1154,7 +1182,7 @@ Bug fixes
|
|
1154
1182
|
|
1155
1183
|
* Allow a `as_null_object` to be passed to `with`
|
1156
1184
|
* Pass proc to block passed to stub (Aubrey Rhodes)
|
1157
|
-
* Initialize child message expectation args to match any args (#109 -
|
1185
|
+
* Initialize child message expectation args to match any args (rspec/rspec-mocks#109 -
|
1158
1186
|
preethiramdev)
|
1159
1187
|
|
1160
1188
|
### 2.8.0 / 2012-01-04
|
@@ -259,10 +259,12 @@ module RSpec
|
|
259
259
|
@observed_methods << method_name
|
260
260
|
backup_method!(method_name)
|
261
261
|
recorder = self
|
262
|
+
method_was_private = @klass.private_method_defined?(method_name)
|
262
263
|
@klass.__send__(:define_method, method_name) do |*args, &blk|
|
263
264
|
recorder.playback!(self, method_name)
|
264
265
|
__send__(method_name, *args, &blk)
|
265
266
|
end
|
267
|
+
@klass.__send__(:private, method_name) if method_was_private
|
266
268
|
@klass.__send__(:ruby2_keywords, method_name) if @klass.respond_to?(:ruby2_keywords, true)
|
267
269
|
end
|
268
270
|
|
@@ -68,7 +68,7 @@ module RSpec
|
|
68
68
|
# counter.count # => 3
|
69
69
|
# counter.count # => 3
|
70
70
|
# # etc
|
71
|
-
def and_return(first_value, *values)
|
71
|
+
def and_return(first_value, *values, &_block)
|
72
72
|
raise_already_invoked_error_if_necessary(__method__)
|
73
73
|
if negative?
|
74
74
|
raise "`and_return` is not supported with negative message expectations"
|
@@ -106,7 +106,7 @@ module RSpec
|
|
106
106
|
# api.get_foo # => :a_foo
|
107
107
|
# api.get_foo # => :a_foo
|
108
108
|
# # etc
|
109
|
-
def and_invoke(first_proc, *procs)
|
109
|
+
def and_invoke(first_proc, *procs, &_block)
|
110
110
|
raise_already_invoked_error_if_necessary(__method__)
|
111
111
|
if negative?
|
112
112
|
raise "`and_invoke` is not supported with negative message expectations"
|
@@ -400,6 +400,9 @@ module RSpec
|
|
400
400
|
end
|
401
401
|
alias inspect to_s
|
402
402
|
|
403
|
+
# Implementation details is a long module
|
404
|
+
# rubocop:disable Metrics/ModuleLength
|
405
|
+
|
403
406
|
# @private
|
404
407
|
# Contains the parts of `MessageExpectation` that aren't part of
|
405
408
|
# rspec-mocks' public API. The class is very big and could really use
|
@@ -436,6 +439,8 @@ module RSpec
|
|
436
439
|
@ordered = false
|
437
440
|
@at_least = @at_most = @exactly = nil
|
438
441
|
|
442
|
+
self.invoking_internals = false
|
443
|
+
|
439
444
|
# Initialized to nil so that we don't allocate an array for every
|
440
445
|
# mock or stub. See also comment in `and_yield`.
|
441
446
|
@args_to_yield = nil
|
@@ -471,10 +476,19 @@ module RSpec
|
|
471
476
|
ruby2_keywords :safe_invoke if respond_to?(:ruby2_keywords, true)
|
472
477
|
|
473
478
|
def invoke(parent_stub, *args, &block)
|
474
|
-
|
479
|
+
if invoking_internals
|
480
|
+
safe_invoke_without_incrementing_received_count(parent_stub, *args, &block)
|
481
|
+
else
|
482
|
+
invoke_incrementing_actual_calls_by(1, true, parent_stub, *args, &block)
|
483
|
+
end
|
475
484
|
end
|
476
485
|
ruby2_keywords :invoke if respond_to?(:ruby2_keywords, true)
|
477
486
|
|
487
|
+
def safe_invoke_without_incrementing_received_count(parent_stub, *args, &block)
|
488
|
+
invoke_incrementing_actual_calls_by(0, false, parent_stub, *args, &block)
|
489
|
+
end
|
490
|
+
ruby2_keywords :safe_invoke_without_incrementing_received_count if respond_to?(:ruby2_keywords, true)
|
491
|
+
|
478
492
|
def invoke_without_incrementing_received_count(parent_stub, *args, &block)
|
479
493
|
invoke_incrementing_actual_calls_by(0, true, parent_stub, *args, &block)
|
480
494
|
end
|
@@ -601,7 +615,17 @@ module RSpec
|
|
601
615
|
@exception_source_id ||= "#{self.class.name} #{__id__}"
|
602
616
|
end
|
603
617
|
|
618
|
+
def invoking_internals
|
619
|
+
RSpec::Support.thread_local_data[:"__rspec_#{object_id}_invoking_internals"]
|
620
|
+
end
|
621
|
+
|
622
|
+
def invoking_internals=(value)
|
623
|
+
RSpec::Support.thread_local_data[:"__rspec_#{object_id}_invoking_internals"] = value
|
624
|
+
end
|
625
|
+
|
604
626
|
def invoke_incrementing_actual_calls_by(increment, allowed_to_fail, parent_stub, *args, &block)
|
627
|
+
self.invoking_internals = true
|
628
|
+
|
605
629
|
args.unshift(orig_object) if yield_receiver_to_implementation_block?
|
606
630
|
|
607
631
|
if negative? || (allowed_to_fail && (@exactly || @at_most) && (@actual_received_count == @expected_received_count))
|
@@ -617,12 +641,15 @@ module RSpec
|
|
617
641
|
|
618
642
|
@order_group.handle_order_constraint self
|
619
643
|
|
644
|
+
self.invoking_internals = false
|
645
|
+
|
620
646
|
if implementation.present?
|
621
647
|
implementation.call(*args, &block)
|
622
648
|
elsif parent_stub
|
623
649
|
parent_stub.invoke(nil, *args, &block)
|
624
650
|
end
|
625
651
|
ensure
|
652
|
+
self.invoking_internals = false
|
626
653
|
@actual_received_count_write_mutex.synchronize do
|
627
654
|
@actual_received_count += increment
|
628
655
|
end
|
@@ -688,6 +715,7 @@ module RSpec
|
|
688
715
|
|
689
716
|
include ImplementationDetails
|
690
717
|
end
|
718
|
+
# rubocop:enable Metrics/ModuleLength
|
691
719
|
|
692
720
|
# Handles the implementation of an `and_yield` declaration.
|
693
721
|
# @private
|
@@ -748,6 +776,7 @@ module RSpec
|
|
748
776
|
|
749
777
|
proc.call(*args, &block)
|
750
778
|
end
|
779
|
+
ruby2_keywords(:call) if respond_to?(:ruby2_keywords, true)
|
751
780
|
end
|
752
781
|
|
753
782
|
# Represents a configured implementation. Takes into account
|
data/lib/rspec/mocks/syntax.rb
CHANGED
@@ -115,7 +115,7 @@ module RSpec
|
|
115
115
|
Matchers::Receive.new(method_name, block)
|
116
116
|
end
|
117
117
|
|
118
|
-
def receive_messages(message_return_value_hash)
|
118
|
+
def receive_messages(message_return_value_hash, &_block)
|
119
119
|
matcher = Matchers::ReceiveMessages.new(message_return_value_hash)
|
120
120
|
matcher.warn_about_block if block_given?
|
121
121
|
matcher
|
@@ -36,12 +36,14 @@ module RSpec
|
|
36
36
|
|
37
37
|
# Redefining `__send__` causes ruby to issue a warning.
|
38
38
|
old, $VERBOSE = $VERBOSE, nil
|
39
|
+
# rubocop:disable Naming/MethodName
|
39
40
|
def __send__(name, *args, &block)
|
40
41
|
@__sending_message = name
|
41
42
|
super
|
42
43
|
ensure
|
43
44
|
@__sending_message = nil
|
44
45
|
end
|
46
|
+
# rubocop:enable Naming/MethodName
|
45
47
|
ruby2_keywords :__send__ if respond_to?(:ruby2_keywords, true)
|
46
48
|
$VERBOSE = old
|
47
49
|
|
data/lib/rspec/mocks/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,22 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-mocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.13.
|
4
|
+
version: 3.13.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Baker
|
8
8
|
- David Chelimsky
|
9
9
|
- Myron Marston
|
10
|
-
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain:
|
13
12
|
- |
|
14
13
|
-----BEGIN CERTIFICATE-----
|
15
|
-
|
14
|
+
MIIFvjCCA6agAwIBAgIJAPXjfUbCjdXVMA0GCSqGSIb3DQEBCwUAMIGAMQswCQYD
|
16
15
|
VQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEO
|
17
16
|
MAwGA1UECgwFUlNwZWMxEzARBgNVBAMMCnJzcGVjLmluZm8xJTAjBgkqhkiG9w0B
|
18
|
-
|
19
|
-
|
17
|
+
CQEWFnJzcGVjQGdvb2dsZWdyb3Vwcy5jb20wHhcNMjUwMjA2MTE0NjU2WhcNMjYw
|
18
|
+
MjA2MTE0NjU2WjCBgDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24x
|
20
19
|
EDAOBgNVBAcMB1NlYXR0bGUxDjAMBgNVBAoMBVJTcGVjMRMwEQYDVQQDDApyc3Bl
|
21
20
|
Yy5pbmZvMSUwIwYJKoZIhvcNAQkBFhZyc3BlY0Bnb29nbGVncm91cHMuY29tMIIC
|
22
21
|
IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAsSmjgcHaKlD0jizRJowi2bGI
|
@@ -30,22 +29,21 @@ cert_chain:
|
|
30
29
|
Xeh3EVdWY3vMB1pkhPwlsenpcmj5gOzrd54lELOVbCGHCf48iSqeflY2Lhe0pvzK
|
31
30
|
blXCJBDmtrebvus291rM/dHcbEfK1SVd5Wut/n131iouf6dnNCFskFygDcgBbthC
|
32
31
|
gpEMqf80lEmhX59VUsm0Pv6OEo+ZPHBvXPiJA6DShQh9t3YtpwyA8uVDMbT/i32u
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
+
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
F3MdtaDehhjC
|
32
|
+
2FUsqZbbJcCmkBrGposCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
33
|
+
HQYDVR0OBBYEFPPvQ5XT0Nvuhi6k+hrWVv35J+TeMA0GCSqGSIb3DQEBCwUAA4IC
|
34
|
+
AQBGBr0ll2yLrkO6IeK5Q7qZFnANaUCKfi6Of9VztZJXgKAU5KAQxyOidGktoA5N
|
35
|
+
lp+bFKudRkW8jSehqoNaNBdSZ9Bc07EGMXIhUFJZF9rq7Z2SKPwUm6EaSsBK13QR
|
36
|
+
U4K6wuaw5ZJSFzklapoGOJRGnFlnNtlhNFY6+tTwCeblwZbcuYGyGY8+Rg7GbyVl
|
37
|
+
3Tr4Gi1aS/qG/MDXKdE8HWm39dmaAMdbw6dg1VBd0JrX2VqH7xvE1dM/D3OlKrNp
|
38
|
+
gNFRNJig3Y8qPjocZR0cGkhgZoC9wribWxHSNawZm4CoV3fja2HNx9QyM7BaB+as
|
39
|
+
yuqAiBbA7vBcyc8nKATip3mxbyXYXoDD7nmO8JCPP7O/WsgG+U/B2a0kPdvYFoxE
|
40
|
+
Q0Js3GtFCuMvL+0rifqdxBOLtu0Pw9q4RvToTJIl2IR6eTgCb82B1hw9qKf7PjuL
|
41
|
+
BoEsYjjDhGw6FZvcJG8O6uj7aB+z4aF21YR74UGL7sq/RIPNNez5JI95jTGfqCPy
|
42
|
+
6yo0w3zja3yg28QK3Fj+tbOHeSLv9SDQWi/1jiPprGzbxGvbVvjvX11YZc46vkmY
|
43
|
+
AwP+qZPPf97FXXZGEGIYhhHpnj+Ltx9nCetRPiZ4rvYBcXgCWVQSg6eiEofrMwn/
|
44
|
+
AKMCABhZ1Y2eATsfMgdkmIZk7JIPZiSi6eUxPiCMP9M/pw==
|
47
45
|
-----END CERTIFICATE-----
|
48
|
-
date:
|
46
|
+
date: 2025-05-05 00:00:00.000000000 Z
|
49
47
|
dependencies:
|
50
48
|
- !ruby/object:Gem::Dependency
|
51
49
|
name: rspec-support
|
@@ -81,68 +79,6 @@ dependencies:
|
|
81
79
|
- - "<"
|
82
80
|
- !ruby/object:Gem::Version
|
83
81
|
version: '2.0'
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: rake
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- - ">"
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: 10.0.0
|
91
|
-
type: :development
|
92
|
-
prerelease: false
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - ">"
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: 10.0.0
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: cucumber
|
100
|
-
requirement: !ruby/object:Gem::Requirement
|
101
|
-
requirements:
|
102
|
-
- - ">="
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
version: '1.3'
|
105
|
-
type: :development
|
106
|
-
prerelease: false
|
107
|
-
version_requirements: !ruby/object:Gem::Requirement
|
108
|
-
requirements:
|
109
|
-
- - ">="
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version: '1.3'
|
112
|
-
- !ruby/object:Gem::Dependency
|
113
|
-
name: aruba
|
114
|
-
requirement: !ruby/object:Gem::Requirement
|
115
|
-
requirements:
|
116
|
-
- - ">="
|
117
|
-
- !ruby/object:Gem::Version
|
118
|
-
version: 1.1.0
|
119
|
-
- - "<"
|
120
|
-
- !ruby/object:Gem::Version
|
121
|
-
version: 3.0.0
|
122
|
-
type: :development
|
123
|
-
prerelease: false
|
124
|
-
version_requirements: !ruby/object:Gem::Requirement
|
125
|
-
requirements:
|
126
|
-
- - ">="
|
127
|
-
- !ruby/object:Gem::Version
|
128
|
-
version: 1.1.0
|
129
|
-
- - "<"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: 3.0.0
|
132
|
-
- !ruby/object:Gem::Dependency
|
133
|
-
name: minitest
|
134
|
-
requirement: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '5.2'
|
139
|
-
type: :development
|
140
|
-
prerelease: false
|
141
|
-
version_requirements: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - "~>"
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '5.2'
|
146
82
|
description: RSpec's 'test double' framework, with support for stubbing and mocking
|
147
83
|
email: rspec@googlegroups.com
|
148
84
|
executables: []
|
@@ -199,12 +135,12 @@ homepage: https://github.com/rspec/rspec-mocks
|
|
199
135
|
licenses:
|
200
136
|
- MIT
|
201
137
|
metadata:
|
202
|
-
bug_tracker_uri: https://github.com/rspec/rspec
|
203
|
-
changelog_uri: https://github.com/rspec/rspec
|
138
|
+
bug_tracker_uri: https://github.com/rspec/rspec/issues
|
139
|
+
changelog_uri: https://github.com/rspec/rspec/blob/rspec-mocks-v3.13.4/rspec-mocks/Changelog.md
|
204
140
|
documentation_uri: https://rspec.info/documentation/
|
205
141
|
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
206
|
-
|
207
|
-
|
142
|
+
rubygems_mfa_required: 'true'
|
143
|
+
source_code_uri: https://github.com/rspec/rspec/blob/rspec-mocks-v3.13.4/rspec-mocks
|
208
144
|
rdoc_options:
|
209
145
|
- "--charset=UTF-8"
|
210
146
|
require_paths:
|
@@ -220,8 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
156
|
- !ruby/object:Gem::Version
|
221
157
|
version: '0'
|
222
158
|
requirements: []
|
223
|
-
rubygems_version: 3.
|
224
|
-
signing_key:
|
159
|
+
rubygems_version: 3.6.2
|
225
160
|
specification_version: 4
|
226
|
-
summary: rspec-mocks-3.13.
|
161
|
+
summary: rspec-mocks-3.13.4
|
227
162
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|