On Thu, Jan 22, 2009 at 4:45 PM, Francis Fish <[email protected]>wrote:

> Erm ... if you *really* do want to do this you've got should_receive, that
> you can also combine with mocks with and_return to avoid hitting the
> database.
>
>
>     it "should set the @tag_list instance variable" do
>       @thing.should_receive(:tag_list=)
>       @thing.whatever_method_makes_this_happen
>     end
>
> I have no time for more than a one-liner a the mo tho.
>
> F
>


Forgot to mention - you can easily end up writing the code in twice (as in
once as a set of expectations and the second time for real) if you do this,
stubbing out the internals of a method. It gets a) brittle and b) old very
quickly and needs to be done only when you really need it.

Ashley's point about the public API in a later post is a good one too.

F

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to