On 20 Oct 2009, at 09:21, Ashley Moran wrote: > > Note that the first expectation uses the mock as a mock (as > traditionally defined) object, but the second uses it as a stub > object. > > What do you call an object that apparently changes its inherent nature > (as traditionally defined) between examples in the same description > block? >
Ah ok. I see what you're getting at. You can't necessarily call an object just a Mock Object or a Stub, if you can use it for both. Fair enough. I'd be more inclined to distinguish between the actions of mocking and stubbing. The fact that they can be combined in a single object doesn't bother me. After all it's just a matter of applying two patterns to the same object, which isn't that unusual. Just because one object could be both a Flyweight and a Proxy doesn't mean the patterns should be conflated. (He says choosing two patterns at random.) Incidentally mixing mocking and stubbing on the same object isn't new to Ruby. I'm pretty sure you can do that in Java mocking frameworks too, eg JMock. Of course it's more elegant in Ruby - but it would be. ---------------- Paul Wilson http://edgecase.com http://merecomplexities.com http://scottishrubyconf.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "NWRUG" 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/nwrug-members?hl=en -~----------~----~----~----~------~----~------~--~---
