rspec-mocks 3.0.4 → 3.12.6

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.
Files changed (49) hide show
  1. checksums.yaml +5 -5
  2. checksums.yaml.gz.sig +0 -0
  3. data/.document +1 -1
  4. data/.yardopts +1 -1
  5. data/Changelog.md +512 -2
  6. data/{License.txt → LICENSE.md} +5 -4
  7. data/README.md +113 -30
  8. data/lib/rspec/mocks/any_instance/chain.rb +5 -3
  9. data/lib/rspec/mocks/any_instance/error_generator.rb +31 -0
  10. data/lib/rspec/mocks/any_instance/expect_chain_chain.rb +1 -5
  11. data/lib/rspec/mocks/any_instance/expectation_chain.rb +9 -8
  12. data/lib/rspec/mocks/any_instance/message_chains.rb +7 -8
  13. data/lib/rspec/mocks/any_instance/proxy.rb +14 -5
  14. data/lib/rspec/mocks/any_instance/recorder.rb +61 -31
  15. data/lib/rspec/mocks/any_instance/stub_chain.rb +15 -11
  16. data/lib/rspec/mocks/any_instance/stub_chain_chain.rb +1 -5
  17. data/lib/rspec/mocks/any_instance.rb +1 -0
  18. data/lib/rspec/mocks/argument_list_matcher.rb +55 -10
  19. data/lib/rspec/mocks/argument_matchers.rb +88 -30
  20. data/lib/rspec/mocks/configuration.rb +61 -13
  21. data/lib/rspec/mocks/error_generator.rb +250 -107
  22. data/lib/rspec/mocks/example_methods.rb +151 -28
  23. data/lib/rspec/mocks/instance_method_stasher.rb +17 -6
  24. data/lib/rspec/mocks/matchers/have_received.rb +50 -20
  25. data/lib/rspec/mocks/matchers/receive.rb +39 -11
  26. data/lib/rspec/mocks/matchers/receive_message_chain.rb +22 -7
  27. data/lib/rspec/mocks/matchers/receive_messages.rb +12 -7
  28. data/lib/rspec/mocks/message_chain.rb +3 -7
  29. data/lib/rspec/mocks/message_expectation.rb +466 -307
  30. data/lib/rspec/mocks/method_double.rb +88 -29
  31. data/lib/rspec/mocks/method_reference.rb +85 -25
  32. data/lib/rspec/mocks/minitest_integration.rb +68 -0
  33. data/lib/rspec/mocks/mutate_const.rb +50 -109
  34. data/lib/rspec/mocks/object_reference.rb +89 -32
  35. data/lib/rspec/mocks/order_group.rb +4 -5
  36. data/lib/rspec/mocks/proxy.rb +156 -60
  37. data/lib/rspec/mocks/space.rb +52 -35
  38. data/lib/rspec/mocks/standalone.rb +1 -1
  39. data/lib/rspec/mocks/syntax.rb +26 -30
  40. data/lib/rspec/mocks/targets.rb +55 -28
  41. data/lib/rspec/mocks/test_double.rb +43 -7
  42. data/lib/rspec/mocks/verifying_double.rb +27 -33
  43. data/lib/rspec/mocks/{verifying_message_expecation.rb → verifying_message_expectation.rb} +11 -16
  44. data/lib/rspec/mocks/verifying_proxy.rb +77 -26
  45. data/lib/rspec/mocks/version.rb +1 -1
  46. data/lib/rspec/mocks.rb +8 -1
  47. data.tar.gz.sig +0 -0
  48. metadata +80 -43
  49. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1c69d8b3717bc8d498e502612ce0507fb46912d3
4
- data.tar.gz: bb8a1856bb4bc4f088349415b610cc6a17e260b3
2
+ SHA256:
3
+ metadata.gz: 51d2892643ca24dce94963c553f2fdee71d55d9c3c2b2d14ba4fb2cb4ed0876a
4
+ data.tar.gz: ceb42a276b994afe0eaffe46e3a7f314393caf5ba39a5804969b955dc9f309d0
5
5
  SHA512:
6
- metadata.gz: 041cac290b56a5efc2a35170ade5b2330184b40f81e1fbe7499d9c67587a1a40d9cc23302e984669136d82005e35a74f1026fe48698d3cd70dbf9a7010e4e706
7
- data.tar.gz: 9faa892d0fc4d9d26a0132ba718b610057b1ebcfaaa042ab25a838f8484451b594596ce003abada7fd4f462822088b6f171a226ad02381c339c013a1193128f4
6
+ metadata.gz: 3d19a308278d05b7703dafc5a88ca5b897badd3e60619fce025937b2ee677e36bea53f9ff2386b4180d107ce45dc695fecb68c69e46d0a4d0ec8063126d30b5f
7
+ data.tar.gz: dd881cdd051593ef697cab19d41b760933daca59768ad12430551743936d4373c575f2cc8cfe496e955e90b3cd965d14ec1f2b097c66f63e5e35e34d720696d9
checksums.yaml.gz.sig CHANGED
Binary file
data/.document CHANGED
@@ -1,5 +1,5 @@
1
1
  lib/**/*.rb
2
2
  -
3
3
  README.md
4
- License.txt
4
+ LICENSE.md
5
5
  Changelog.md
data/.yardopts CHANGED
@@ -3,4 +3,4 @@
3
3
  --markup markdown
4
4
  -
5
5
  Changelog.md
6
- License.txt
6
+ LICENSE.md
data/Changelog.md CHANGED
@@ -1,3 +1,498 @@
1
+ ### Development
2
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.6...3-12-maintenance)
3
+
4
+ ### 3.12.6 / 2023-07-11
5
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.5...v3.12.6)
6
+
7
+ Bug Fixes:
8
+
9
+ * Fix an issue with `and_call_original` when using the `method_missing` fallback
10
+ with keyword arguments. (Igor Drozdov, #1552)
11
+
12
+ ### 3.12.5 / 2023-03-30
13
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.4...v3.12.5)
14
+
15
+ Bug Fixes:
16
+
17
+ * Fix compatibility issue with Rails where active_support monkey patches `with`
18
+ when using any instance. (Lachlan Sylvester, #1540)
19
+
20
+ ### 3.12.4 / 2023-03-12
21
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.3...v3.12.4)
22
+
23
+ Bug Fixes:
24
+
25
+ * Fix an issue with asserting that Array#reverse is never called. (Brad Trick, #1533)
26
+ * Fix compatibility issue with Rails where active_support monkey patches `with`.
27
+ (Jean Boussier, #1531, #1534)
28
+
29
+ ### 3.12.3 / 2023-01-17
30
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.2...v3.12.3)
31
+
32
+ Bug Fixes:
33
+
34
+ * Fix keyword delegation in `send` for verifying doubles on Ruby 3.
35
+ (Charlie Honig, #1485)
36
+
37
+ ### 3.12.2 / 2023-01-07
38
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.1...v3.12.2)
39
+
40
+ Bug Fixes:
41
+
42
+ * Fix implementation blocks for mocks using keyword arguments on Ruby 3.2.0.
43
+ (Adam Steel, #1508)
44
+ * Fix keyword argument assertions when mocking using `with` on Ruby 3.2.0.
45
+ (Slava Kardakov, Benoit Tigeot, Phil Pirozhkov, Benoit Daloze, #1514)
46
+
47
+ ### 3.12.1 / 2022-12-10
48
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.12.0...v3.12.1)
49
+
50
+ Bug Fixes:
51
+
52
+ * Remove empty diff marker when a diff only contains console codes. (Jon Rowe, #1506)
53
+ * Show keyword vs hash diff marker when arguments are not `==` (Jon Rowe, #1506)
54
+ * Change check to detect frozen objects to rescue errors rather than
55
+ pre-empting by checking `frozen?` due to some objects mis-behaving.
56
+ (Keegan Roth, #1401)
57
+ * Prevent unfulfilled expectations using `expect_any_instance_of` across a class
58
+ inheritance boundary from raising rather than failing. (Jon Rowe, #1496)
59
+ * Prevent a misleading error message when using `allow(...).not_to` with
60
+ unsupported matchers. (Phil Pirozhkov, #1503)
61
+
62
+ ### 3.12.0 / 2022-10-26
63
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.11.2...v3.12.0)
64
+
65
+ Enhancements:
66
+
67
+ * Improve diff output when diffing keyword arguments against hashes.
68
+ (Jean Boussier, #1461)
69
+
70
+ ### 3.11.2 / 2022-10-25
71
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.11.1...v3.11.2)
72
+
73
+ Bug Fixes:
74
+
75
+ * Use the original implementation of `Class.new` to detect overridden definitions
76
+ of `new` rather than the owner, fixing detection of "double aliased" methods
77
+ in Ruby 3 and above. (Benoit Daloze, #1470, #1476)
78
+ * Support keyword argument semantics when constraining argument expectations using
79
+ `with` on Ruby 3.0+ with `instance_double` (Andrii Malyshko, #1473)
80
+
81
+ ### 3.11.1 / 2022-03-31
82
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.11.0...v3.11.1)
83
+
84
+ Bug Fixes:
85
+
86
+ * Add extra `ruby2_keywords` calls to properly designate methods using
87
+ `*args` to pass keyword around, fixes an issue with TruffleRuby.
88
+ (Benoit Daloze, #1464)
89
+
90
+ ### 3.11.0 / 2022-02-09
91
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.3...v3.11.0)
92
+
93
+ Enhancements:
94
+
95
+ * Add `and_invoke` implementation for configuring responses to `receive`
96
+ (and `receive_messages`) with multiple callable objects. (Kyle Smith, #1411)
97
+
98
+ ### 3.10.3 / 2022-01-28
99
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.2...v3.10.3)
100
+
101
+ Bug Fixes:
102
+
103
+ * Suppress warning by setting `$VERBOSE` to nil. (Nobuyoshi Nakada, #1414)
104
+ * Support keyword argument semantics when constraining argument expectations using
105
+ `with` on Ruby 3.0+ (Yusuke Endoh, #1394)
106
+
107
+ ### 3.10.2 / 2021-01-27
108
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.1...v3.10.2)
109
+
110
+ Bug Fixes:
111
+
112
+ * Support keyword arguments with `and_call_original` on Ruby 3.0.
113
+ (Bryan Powell, #1385)
114
+ * `RSpec::Mocks::Constant#previously_defined?` is now always a boolean.
115
+ (Phil Pirozhkov, #1397)
116
+ * Support keyword arguments on Ruby 3.0 when used with `expect_any_instance_of`
117
+ or `allow_any_instance_of` with `and_call_original`.
118
+ (Jess Hottenstein, #1407)
119
+
120
+ ### 3.10.1 / 2020-12-27
121
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.10.0...v3.10.1)
122
+
123
+ Bug Fixes:
124
+
125
+ * Issue `ArgumentError` rather than `TypeError` when unsupported methods on
126
+ unsupported objects are attempted to be stubbed. (@zhisme, #1357)
127
+
128
+ ### 3.10.0 / 2020-10-30
129
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.9.1...v3.10.0)
130
+
131
+ Enhancements:
132
+ * Add the ability to set a custom error generator in `MessageExpectation`.
133
+ This will allow rspec-expectations to inject a custom failure message.
134
+ (Benoit Tigeot and Nicolas Zermati, #1312)
135
+ * Return the result of the block passed to `RSpec::Mocks.with_temporary_scope`
136
+ when block run. (@expeehaa, #1329)
137
+
138
+ ### 3.9.1 / 2019-12-31
139
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.9.0...v3.9.1)
140
+
141
+ Bug Fixes:
142
+
143
+ * Trigger `RSpec::Mocks.configuration.verifying_double_callbacks` when using
144
+ `allow_any_instance_of` or `expect_any_instance_of` (Daniel Orner, #1309)
145
+
146
+ ### 3.9.0 / 2019-10-07
147
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.8.2...v3.9.0)
148
+
149
+ Enhancements:
150
+
151
+ * Improve thread safety of message expectations by using Mutex to prevent
152
+ deadlocking errors. (Ry Biesemeyer, #1236)
153
+ * Add the ability to use `time` as an alias for `times`. For example:
154
+ `expect(Class).to receive(:method).exactly(1).time`.
155
+ (Pistos, Benoit Tigeot, #1271)
156
+
157
+ ### 3.8.2 / 2019-10-02
158
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.8.1...v3.8.2)
159
+
160
+ * Allow `array_including` argument matchers to be nested.
161
+ (Emmanuel Delmas, #1291)
162
+
163
+ ### 3.8.1 / 2019-06-13
164
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.8.0...v3.8.1)
165
+
166
+ Bug Fixes:
167
+
168
+ * Ensure stubbing methods does not change their visibility.
169
+ (Kevin Boschert, #1277)
170
+
171
+ ### 3.8.0 / 2018-08-04
172
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.7.0...v3.8.0)
173
+
174
+ Bug Fixes:
175
+
176
+ * Issue error when encountering invalid "counted" negative message expectations.
177
+ (Sergiy Yarinovskiy, #1212)
178
+ * Ensure `allow_any_instance_of` and `expect_any_instance_of` can be temporarily
179
+ supressed. (Jon Rowe, #1228)
180
+ * Ensure `expect_any_instance_of(double).to_not have_received(:some_method)`
181
+ fails gracefully (as its not supported) rather than issuing a `NoMethodError`.
182
+ (Maxim Krizhanovsky, #1231)
183
+
184
+ ### 3.7.0 / 2017-10-17
185
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.6.0...v3.7.0)
186
+
187
+ Enhancements:
188
+
189
+ * Improve compatibility with `--enable-frozen-string-literal` option
190
+ on Ruby 2.3+. (Pat Allan, #1165)
191
+
192
+ Bug Fixes:
193
+
194
+ * Fix `hash_including` and `hash_excluding` so that they work against
195
+ subclasses of `Hash`. (Aaron Rosenberg, #1167)
196
+
197
+ ### 3.6.0 / 2017-05-04
198
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.6.0.beta2...v3.6.0)
199
+
200
+ Bug Fixes:
201
+
202
+ * Fix "instance variable @color not initialized" warning when using
203
+ rspec-mocks without rspec-core. (Myron Marston, #1142)
204
+ * Restore aliased module methods properly when stubbing on 1.8.7.
205
+ (Samuel Giddins, #1144)
206
+ * Allow a message chain expectation to be constrained by argument(s).
207
+ (Jon Rowe, #1156)
208
+
209
+ ### 3.6.0.beta2 / 2016-12-12
210
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.6.0.beta1...v3.6.0.beta2)
211
+
212
+ Enhancements:
213
+
214
+ * Add new `without_partial_double_verification { }` API that lets you
215
+ temporarily turn off partial double verification for an example.
216
+ (Jon Rowe, #1104)
217
+
218
+ ### 3.6.0.beta1 / 2016-10-09
219
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0...v3.6.0.beta1)
220
+
221
+ Bug Fixes:
222
+
223
+ * Return the test double instance form `#freeze` (Alessandro Berardi, #1109)
224
+ * Allow the special logic for stubbing `new` to work when `<Class>.method` has
225
+ been redefined. (Proby, #1119)
226
+
227
+ ### 3.5.0 / 2016-07-01
228
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0.beta4...v3.5.0)
229
+
230
+ Enhancements:
231
+
232
+ * Provides a nice string representation of
233
+ `RSpec::Mocks::MessageExpectation` (Myron Marston, #1095)
234
+
235
+ ### 3.5.0.beta4 / 2016-06-05
236
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0.beta3...v3.5.0.beta4)
237
+
238
+ Enhancements:
239
+
240
+ * Add `and_throw` to any instance handling. (Tobias Bühlmann, #1068)
241
+
242
+ ### 3.5.0.beta3 / 2016-04-02
243
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0.beta2...v3.5.0.beta3)
244
+
245
+ Enhancements:
246
+
247
+ * Issue warning when attempting to use unsupported
248
+ `allow(...).to receive(...).ordered`. (Jon Rowe, #1000)
249
+ * Add `rspec/mocks/minitest_integration`, to properly integrate rspec-mocks
250
+ with minitest. (Myron Marston, #1065)
251
+
252
+ ### 3.5.0.beta2 / 2016-03-10
253
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0.beta1...v3.5.0.beta2)
254
+
255
+ Enhancements:
256
+
257
+ * Improve error message displayed when using `and_wrap_original` on pure test
258
+ doubles. (betesh, #1063)
259
+
260
+ Bug Fixes:
261
+
262
+ * Fix issue that prevented `receive_message_chain(...).with(...)` working
263
+ correctly on "any instance" mocks. (Jon Rowe, #1061)
264
+
265
+ ### 3.5.0.beta1 / 2016-02-06
266
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.4.1...v3.5.0.beta1)
267
+
268
+ Bug Fixes:
269
+
270
+ * Allow `any_instance_of(...).to receive(...)` to use `and_yield` multiple
271
+ times. (Kilian Cirera Sant, #1054)
272
+ * Allow matchers which inherit from `rspec-mocks` matchers to be used for
273
+ `allow`. (Andrew Kozin, #1056)
274
+ * Prevent stubbing `respond_to?` on partial doubles from causing infinite
275
+ recursion. (Jon Rowe, #1013)
276
+ * Prevent aliased methods from disapearing after being mocked with
277
+ `any_instance` (regression from #1043). (Joe Rafaniello, #1060)
278
+
279
+ ### 3.4.1 / 2016-01-10
280
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.4.0...v3.4.1)
281
+
282
+ Bug Fixes:
283
+
284
+ * Fix `any_instance` to work properly on Ruby 2.3. (Joe Rafaniello, #1043)
285
+
286
+ ### 3.4.0 / 2015-11-11
287
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.3.2...v3.4.0)
288
+
289
+ Enhancements:
290
+
291
+ * Make `expect(...).to have_received` work without relying upon
292
+ rspec-expectations. (Myron Marston, #978)
293
+ * Add option for failing tests when expectations are set on `nil`.
294
+ (Liz Rush, #983)
295
+
296
+ Bug Fixes:
297
+
298
+ * Fix `have_received { ... }` so that any block passed when the message
299
+ was received is forwarded to the `have_received` block. (Myron Marston, #1006)
300
+ * Fix infinite loop in error generator when stubbing `respond_to?`.
301
+ (Alex Dowad, #1022)
302
+ * Fix issue with using `receive` on subclasses (at a class level) with 1.8.7.
303
+ (Alex Dowad, #1026)
304
+
305
+ ### 3.3.2 / 2015-07-15
306
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.3.1...v3.3.2)
307
+
308
+ Bug Fixes:
309
+
310
+ * Prevent thread deadlock errors during proxy creation (e.g. when using
311
+ `before_verifying_doubles` callbacks). (Jon Rowe, #980, #979)
312
+
313
+ ### 3.3.1 / 2015-06-19
314
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.3.0...v3.3.1)
315
+
316
+ Bug Fixes:
317
+
318
+ * Fix bug in `before_verifying_double` callback logic that caused it to be called
319
+ once for each class in the ancestor list when mocking or stubbing a class. Now
320
+ it is only called for the mocked or stubbed class, as you would expect. (Sam
321
+ Phippen, #974)
322
+
323
+ ### 3.3.0 / 2015-06-12
324
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.2.1...v3.3.0)
325
+
326
+ Enhancements:
327
+
328
+ * When stubbing `new` on `MyClass` or `class_double(MyClass)`, use the
329
+ method signature from `MyClass#initialize` to verify arguments.
330
+ (Myron Marston, #886)
331
+ * Use matcher descriptions when generating description of received arguments
332
+ for mock expectation failures. (Tim Wade, #891)
333
+ * Avoid loading `stringio` unnecessarily. (Myron Marston, #894)
334
+ * Verifying doubles failure messages now distinguish between class and instance
335
+ level methods. (Tim Wade, #896, #908)
336
+ * Improve mock expectation failure messages so that it combines both
337
+ number of times and the received arguments in the output. (John Ceh, #918)
338
+ * Improve how test doubles are represented in failure messages.
339
+ (Siva Gollapalli, Myron Marston, #932)
340
+ * Rename `RSpec::Mocks::Configuration#when_declaring_verifying_double` to
341
+ `RSpec::Mocks::Configuration#before_verifying_doubles` and utilise when
342
+ verifying partial doubles. (Jon Rowe, #940)
343
+ * Use rspec-support's `ObjectFormatter` for improved formatting of
344
+ arguments in failure messages so that, for example, full time
345
+ precisions is displayed for time objects. (Gavin Miller, Myron Marston, #955)
346
+
347
+ Bug Fixes:
348
+
349
+ * Ensure expectations that raise eagerly also raise during RSpec verification.
350
+ This means that if exceptions are caught inside test execution the test will
351
+ still fail. (Sam Phippen, #884)
352
+ * Fix `have_received(msg).with(args).exactly(n).times` and
353
+ `receive(msg).with(args).exactly(n).times` failure messages
354
+ for when the message was received the wrong number of times with
355
+ the specified args, and also received additional times with other
356
+ arguments. Previously it confusingly listed the arguments as being
357
+ mis-matched (even when the double was allowed to receive with any
358
+ args) rather than listing the count. (John Ceh, #918)
359
+ * Fix `any_args`/`anything` support so that we avoid calling `obj == anything`
360
+ on user objects that may have improperly implemented `==` in a way that
361
+ raises errors. (Myron Marston, #924)
362
+ * Fix edge case involving stubbing the same method on a class and a subclass
363
+ which previously hit a `NoMethodError` internally in RSpec. (Myron Marston #954)
364
+ * Fix edge case where the message received count would be incremented multiple
365
+ times for one failure. (Myron Marston, #957)
366
+ * Fix failure messages for when spies received the expected message with
367
+ different arguments and also received another message. (Maurício Linhares, #960)
368
+ * Silence whitespace-only diffs. (Myron Marston, #969)
369
+
370
+ ### 3.2.1 / 2015-02-23
371
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.2.0...v3.2.1)
372
+
373
+ Bug Fixes:
374
+
375
+ * Add missing `rspec/support/differ` require so that rspec-mocks can be
376
+ used w/o rspec-expectations (which also loads the differ and hided the
377
+ fact we forgot to require it). (Myron Marston, #893)
378
+ * Revert tracking of received arg mutation (added in 3.2.0 to provide an
379
+ error in a situation we can't support) as our implementation has side
380
+ effects on non-standard objects and there's no solution we could come
381
+ up with that always works. (Myron Marston, #900)
382
+
383
+ ### 3.2.0 / 2015-02-03
384
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.1.3...v3.2.0)
385
+
386
+ Enhancements:
387
+
388
+ * Treat `any_args` as an arg splat, allowing it to match an arbitrary
389
+ number of args at any point in an arg list. (Myron Marston, #786)
390
+ * Print diffs when arguments in mock expectations are mismatched.
391
+ (Sam Phippen, #751)
392
+ * Support names for verified doubles (`instance_double`, `instance_spy`,
393
+ `class_double`, `class_spy`, `object_double`, `object_spy`). (Cezary
394
+ Baginski, #826)
395
+ * Make `array_including` and `hash_including` argument matchers composable.
396
+ (Sam Phippen, #819)
397
+ * Make `allow_any_instance_of(...).to receive(...).and_wrap_original`
398
+ work. (Ryan Fitzgerald, #869)
399
+
400
+ Bug Fixes:
401
+
402
+ * Provide a clear error when users wrongly combine `no_args` with
403
+ additional arguments (e.g. `expect().to receive().with(no_args, 1)`).
404
+ (Myron Marston, #786)
405
+ * Provide a clear error when users wrongly use `any_args` multiple times in the
406
+ same argument list (e.g. `expect().to receive().with(any_args, 1, any_args)`.
407
+ (Myron Marston, #786)
408
+ * Prevent the error generator from using user object #description methods.
409
+ See [#685](https://github.com/rspec/rspec-mocks/issues/685).
410
+ (Sam Phippen, #751)
411
+ * Make verified doubles declared as `(instance|class)_double(SomeConst)`
412
+ work properly when `SomeConst` has previously been stubbed.
413
+ `(instance|class)_double("SomeClass")` already worked properly.
414
+ (Myron Marston, #824)
415
+ * Add a matcher description for `receive`, `receive_messages` and
416
+ `receive_message_chain`. (Myron Marston, #828)
417
+ * Validate invocation args for null object verified doubles.
418
+ (Myron Marston, #829)
419
+ * Fix `RSpec::Mocks::Constant.original` when called with an invalid
420
+ constant to return an object indicating the constant name is invalid,
421
+ rather than blowing up. (Myron Marston, #833)
422
+ * Make `extend RSpec::Mocks::ExampleMethods` on any object work properly
423
+ to add the rspec-mocks API to that object. Previously, `expect` would
424
+ be undefined. (Myron Marston, #846)
425
+ * Fix `require 'rspec/mocks/standalone'` so that it only affects `main`
426
+ and not every object. It's really only intended to be used in a REPL
427
+ like IRB, but some gems have loaded it, thinking it needs to be loaded
428
+ when using rspec-mocks outside the context of rspec-core.
429
+ (Myron Marston, #846)
430
+ * Prevent message expectations from being modified by customization methods
431
+ (e.g. `with`) after they have been invoked. (Sam Phippen and Melanie Gilman, #837)
432
+ * Handle cases where a method stub cannot be removed due to something
433
+ external to RSpec monkeying with the method definition. This can
434
+ happen, for example, when you `file.reopen(io)` after previously
435
+ stubbing a method on the `file` object. (Myron Marston, #853)
436
+ * Provide a clear error when received message args are mutated before
437
+ a `have_received(...).with(...)` expectation. (Myron Marston, #868)
438
+
439
+ ### 3.1.3 / 2014-10-08
440
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.1.2...v3.1.3)
441
+
442
+ Bug Fixes:
443
+
444
+ * Correct received messages count when used with `have_received` matcher.
445
+ (Jon Rowe, #793)
446
+ * Provide a clear error message when you use `allow_any_instance_of(...)` or
447
+ `expect_any_instance_of(...)` with the `have_received` matcher (they are
448
+ not intended to be used together and previously caused an odd internal
449
+ failure in rspec-mocks). (Jon Rowe, #799).
450
+ * Fix verified double `with` verification so that it applies to method
451
+ stubs. (Myron Marston, #790)
452
+
453
+ ### 3.1.2 / 2014-09-26
454
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.1.1...v3.1.2)
455
+
456
+ Bug Fixes:
457
+
458
+ * Provide a clear error message when you use `allow(...)` with the
459
+ `have_received` matcher (they are not intended to be used together
460
+ and previously caused an odd internal failure in rspec-mocks). (Jon Rowe, #788).
461
+
462
+ ### 3.1.1 / 2014-09-18
463
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.1.0...v3.1.1)
464
+
465
+ Bug Fixes:
466
+
467
+ * Prevent included modules being detected as prepended modules on Ruby 2.0
468
+ when using `any_instance_of(...)`. (Tony Novak, #781)
469
+
470
+ ### 3.1.0 / 2014-09-04
471
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.0.4...v3.1.0)
472
+
473
+ Enhancements:
474
+
475
+ * Add spying methods (`spy`, `ìnstance_spy`, `class_spy` and `object_spy`)
476
+ which create doubles as null objects for use with spying in testing. (Sam
477
+ Phippen, #671)
478
+ * `have_received` matcher will raise "does not implement" errors correctly when
479
+ used with verifying doubles and partial doubles. (Xavier Shay, #722)
480
+ * Allow matchers to be used in place of keyword arguments in `with`
481
+ expectations. (Xavier Shay, #726)
482
+ * Add `thrice` modifier to message expectation interface as a synonym
483
+ for `exactly(3).times`. (Dennis Taylor, #753)
484
+ * Add more `thrice` synonyms e.g. `.at_least(:thrice)`, `.at_most(:thrice)`,
485
+ `receive(...).thrice` and `have_received(...).thrice`. (Jon Rowe, #754)
486
+ * Add `and_wrap_original` modifier for partial doubles to mutate the
487
+ response from a method. (Jon Rowe, #762)
488
+
489
+ Bug Fixes:
490
+
491
+ * Remove `any_number_of_times` from `any_instance` recorders that were
492
+ erroneously causing mention of the method in documentation. (Jon Rowe, #760)
493
+ * Prevent included modules being detected as prepended modules on Ruby 2.0.
494
+ (Eugene Kenny, #771)
495
+
1
496
  ### 3.0.4 / 2014-08-14
2
497
  [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.0.3...v3.0.4)
3
498
 
@@ -183,7 +678,7 @@ Bug Fixes:
183
678
  behavior. (Maurício Linhares)
184
679
 
185
680
  ### 3.0.0.beta1 / 2013-11-07
186
- [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.99.2...v3.0.0.beta1)
681
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.99.4...v3.0.0.beta1)
187
682
 
188
683
  Breaking Changes for 3.0.0:
189
684
 
@@ -246,6 +741,20 @@ Bug Fixes:
246
741
  returns `nil` or `''` so that you still get a useful message.
247
742
  (Nick DeLuca)
248
743
 
744
+ ### 2.99.4 / 2015-06-19
745
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.99.3...v2.99.4)
746
+
747
+ Bug Fixes:
748
+
749
+ * Add missing deprecation for using `with` with no arguments e.g. `with()`. (Yousuke, #970)
750
+
751
+ ### 2.99.3 / 2015-01-09
752
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.99.2...v2.99.3)
753
+
754
+ Bug Fixes:
755
+
756
+ * Fix regression that caused an error when a test double was deserialized from YAML. (Yuji Nakayama, #777)
757
+
249
758
  ### 2.99.2 / 2014-07-21
250
759
  [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.99.1...v2.99.2)
251
760
 
@@ -567,7 +1076,8 @@ Bug fixes
567
1076
  * Fix `should_receive` so that when it is called on an `as_null_object`
568
1077
  double with no implementation, and there is a previous explicit stub
569
1078
  for the same method, the explicit stub remains (rather than being
570
- overriden with the null object implementation--`return self`). (Myron Marston)
1079
+ overridden with the null object implementation--`return self`). (Myron
1080
+ Marston)
571
1081
 
572
1082
  ### 2.11.0 / 2012-07-07
573
1083
  [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.10.1...v2.11.0)
@@ -1,8 +1,9 @@
1
- (The MIT License)
1
+ The MIT License (MIT)
2
+ =====================
2
3
 
3
- Copyright (c) 2012 David Chelimsky, Myron Marston
4
- Copyright (c) 2006 David Chelimsky, The RSpec Development Team
5
- Copyright (c) 2005 Steven Baker
4
+ * Copyright © 2012 David Chelimsky, Myron Marston
5
+ * Copyright © 2006 David Chelimsky, The RSpec Development Team
6
+ * Copyright © 2005 Steven Baker
6
7
 
7
8
  Permission is hereby granted, free of charge, to any person obtaining
8
9
  a copy of this software and associated documentation files (the