2008-07-23 04:37, Ry An:
> User.stub!(:find).with(1).and_return(@user)
> User.stub!(:find).with(2).and_return(@user2)
> 
> the second call returns
> undefined local variable or method `find' for
> #<Class:0x7faf42964d00>

This is a kludge, but you might be able to work around your situation
using

  User.stub!(:find).and_return { ... calculate retval ... }

or

  User.stub!(:find).and_return(@user, @user2)

see http://rspec.info/documentation/mocks/stubs.html

> Any ideas as to why this is not working? or better still how to get
> it working.

Uhh, no idea, sorry.

-- 
Tero Tilus ## 050 3635 235 ## http://www.tilus.net/koti/tero/
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to