[rspec-devel] stubs

Luke Redpath luke at agileevolved.com
Mon Oct 2 07:41:30 EDT 2006


I'm pretty sure that find() is defined in ActiveRecord::Base  
explicitly. I never had any problems stubbing find() with Stubba.

However, I was never able to stub the methods that are definately  
generated at run-time, such as find_by_* and related finders.

Cheers
Luke

> I think it's a conflict w/ rails' usage of the Story metaclass. Here's
> my theory (something akin to a wild ass guess) :new is defined on
> Story when it is initially loaded, but :find is added by rails at
> runtime, making a new metaclass. RSpec is telling Story to stub!
> :find, but :find is not defined on Story, it's defined on a run-time
> rails variation of Story.
>
> Any thoughts on this?
>
> David
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel



More information about the rspec-devel mailing list