[rspec-users] any_instance

Bram brambomail at gmail.com
Wed Nov 2 18:41:44 EDT 2011


I'm trying to stub out a method with the any_instance method, this
works well if I run the spec individually however when I do a full run
it will call the actual method:

example "" do
 Library::Class.any_instance.stub(:method).and_return true

This will fire off the before_save method in ModelObserver and call

running "bundle exec rspec spec/observer/model_observer.rb" works
"bundle exec rspec" will call the actual method.

Any clues as to what could be wrong?

Thanks in advanced.

More information about the rspec-users mailing list