[rspec-users] 2nd attempt at mocking and stubbing
mark at mwilden.com
Sun Sep 7 16:21:52 EDT 2008
On Sat, Sep 6, 2008 at 8:00 PM, David Chelimsky <dchelimsky at gmail.com>wrote:
> class Property
> def add_marker_to(map)
> map.add_marker Marker.new(address, latitude, longitude, contents)
> That reduces the surface contact between the Property and the Map even
The surface contact between those objects is indeed reduced. But now the map
has to ask the marker for this information, rather than the property. The
number of surface contact points just increased by one.
Plus, the information is still copied instead of referenced. Which means
that if someone made a typo in the property's address, they'd have to
remember to copy it to the map again.
Anyway, there are lots of ways to skin cats, and it's interesting to discuss
them (if not necessarily rspecy).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users