On Sat, Jun 18, 2011 at 21:10, Karl <threadh...@gmail.com> wrote:

> Found my problem... mostly due to my misunderstanding of mocks. Joe's
> suggestion above led me down the right path. This worked:
>
> @account = mock_model(Account)
> @account.stub!(:next_serial_number).and_return(43, nil)
> Widget.any_instance.stub(:account).and_return(@account)

I'm glad you found something that did what you wanted. Now what are
you trying to do with it? I've never wanted to stub
:next_serial_number before, so I'd like to understand the situation
you find yourself in, for when that happens to me.
-- 
J. B. (Joe) Rainsberger :: http://www.jbrains.ca ::
http://blog.thecodewhisperer.com
Diaspar Software Services :: http://www.diasparsoftware.com
Author, JUnit Recipes
2005 Gordon Pask Award for contribution to Agile practice :: Agile
2010: Learn. Practice. Explore.
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to