Phlip wrote: [...] > Mock almost nothing - the clock, the wire out of your > workstation, and system errors.
I was at a loss to understand this until I read the following sentence. > > Everything else should be so clean and decoupled that you can use it as > stubs > without mocking it. I suppose I was speaking inexactly. I think of a stub as a special case of mock, and was writing from that point of view. My original statement should have read: Stub everything that isn't what you're directly testing. If for some reason you can't stub it, *then* mock it. Or more simply: If it isn't what you're testing, fake it! Is that a more acceptable method? > Mocks just tell your tests what they think they want > to > hear, True, although sometimes that can be useful to isolate problems. > and the mocks interfere with refactoring and decoupling. How? By making a test too dependent on another object's interface? But don't stubs do that too? Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

