[rspec-users] Mocks and Refactoring - doing it wrong?

Scott Taylor mailing_lists at railsnewbie.com
Thu Oct 30 21:24:14 EDT 2008

On Oct 30, 2008, at 7:52 PM, Sebastian W. wrote:

>> No idea why you couldn't pass a flag for regression testing:
>> mock(Foo, :check_methods => true)
>> Scott
> It seems to me this way, too - though I'm obviously biased. :)
> It's true that a lot of the dynamic stuff could be problematic -  
> what if
> the flag was only for checking methods directly implemented on that
> class? Though I guess that'd lead down a potential dark path where  
> you'd
> then also want the "mock" method to potentially check all mixins and
> validate, etc. etc.
> On the other hand, maybe it could serve as a gentle remonstrance to
> folks to not overdo it with the "i am an 3l337 ninj4 haxx0r"
> metaprogramming? Just a thought.


Tests *are* supposed to influence the way we write production code.


More information about the rspec-users mailing list