not_a_mock
not_a_mock copied to clipboard
Not compatible with rspec 2.x
This is actually an rspec 2 issue, but I'm recording it here for others reference.
The config.mock_with method in rspec 2 takes a symbol or string instead of a module and has a hard coded list of acceptable mocking frameworks, so passing the NotAMock adaptor does nothing.
This prevents stubs and mocks from being reset after each example.
The work around until (if?) rspec allows arbitrary mocking frameworks again is to add the following code to spec_helper.rb
config.before(:each) do
NotAMock::CallRecorder.instance.reset
NotAMock::Stubber.instance.reset
end