[rspec-users] 2nd attempt at mocking and stubbing

David Chelimsky dchelimsky at gmail.com
Sat Sep 6 22:58:55 EDT 2008


On Sat, Sep 6, 2008 at 5:25 PM, Mark Wilden <mark at mwilden.com> wrote:
>> 203
>> 204       map.should_receive(:add_marker).with mock_property1.address,
>> mock_property1.latitude, mock_property1.longitude, marker1_contents
>> 205       map.should_receive(:add_marker).with mock_property2.address,
>> mock_property2.latitude, mock_property2.longitude, marker2_contents
>
> It looks like this is copying certain property properties to the map. Would
> it be better for the map to simply hold a reference to the property?

That might clean up the interactions a bit, but then you've still got
the map asking the properties for its data.

I think the property knows it's location, it should provide that information.

>
> ///ark
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list