[rspec-users] warn on stubbing nonexistent method?

Evgeniy Dolzhenko dolzenko at gmail.com
Fri Aug 26 14:28:46 EDT 2011


Roger,

Check the list archives - this topic is brought up every other 3 months :)

On 8/26/2011 9:02 PM, Roger Pack wrote:
> Hello.
> Perhaps rspec-mocks could warn if it stubs a not yet existing method?
>
>
> class A
> end
>
> describe RSpec do
>   it 'should' do
>     a = A.new
>     a.stub!(:nonexistent_method) {}
>   end
> end
>
> This might help the development process by pointing out possible
> discrepancies between rspec tests and the code (for when refactoring
> wasn't performed fully et al).
> Cheers!
> -roger-
>



More information about the rspec-users mailing list