rspec-mocks 3.13.1 → 3.13.3

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