Make Marshal monkey-patch opt-in.
Address YARD warnings.
They were listed as being methods on `RSpec::Mocks`. By defining the docs within `BasicObject` and `Class` they are rendered properly.
See lsegal/yard#746 for discussion.
100% doc coverage
Demonstrate issue with stubbing out a class that's been prepended.
This was needed because of a bug in our prepended module detection. The logic was originally written against ruby 2.1, where `object.singleton_class.ancestors` always includes the singleton class. On ruby 2.0, it only includes the singleton class if there is a prepended module. If there is not a prepended module, it's not in the ancestors array and our `take_while` logic considered EVERY ancestor to be a prepended module even though there were none. Instead, we can find the prepended module by taking all ancestors until the first class.
If we don't rescue this error, then it can leave partial doubles in a permanently inconsistent state for the rest of the process. The best we can do is just rescue and issue a warning.
- If the user prepends another module between examples, our module may no longer take precedence. - Fix the pollution spec -- it wasn't actually failing properly.
- Add spec showing that we don't mutate the ancestor chain in cases where there is no prepended module overriding the method. - Handle objects with multiple prepended modules. - Extract prepended_modules method on proxy. It is memoized, which can improve perf a bit if multiple methods get stubbed. - Rename method.
It's for any object with a prepended module in its singleton class's ancestor chain.
Don't double reset
Add missing argument matcher descriptions, specs for descriptions
spec/rspec/mocks/any_instance_spec.rb:1053: warning: assigned but unused variable - e
Resetting should not happen until the reset phase. Fixes #590.
Allow verifying partial doubles to expect private methods.
… partial doubles. Fixes #603.
In rspec-fire it was possible for this error to contain multiple method names, so newlines made sense. Given how it is now implemented, this cannot happen.
Migrate spec syntax
Since we've migrated to the expect syntax we lost a lot of test coverage for the should syntax. For the most part we don't need everything covered for both because it's the same underlying mechanisms but some sanity tests are nice.