Any_instance

Hello,

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
Model.create
end

This will fire off the before_save method in ModelObserver and call
Library::Class.method.

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.

Any clues as to what could be wrong?
It’s either a bug or some other tests have side effects that only show
up when run together. Let me try to replicate it on one of my
codebases and get back to you.

Best,
Sidu P…
http://c42.in
http://rubymonk.com