[rspec-devel] huge setup methods? I think I'm on the wrong path

Jens-Christian Fischer jcfischer.lists at gmail.com
Wed Jan 24 16:26:29 EST 2007

> If the view needs to ask a lot of questions, then your setup is going
> to look something like that. You can, though, clean things up a little
> bit:

> [... snip ...]
> This will cause the mock to ignore calls that it isn't interested in,
> so you won't get failures by sending messages. If, however, your view
> has any trainwrecks in it (user.address.zipcode), then you'd have to
> supply something specific to return for address.

Yes - there are quite a few trainwrecks :-) That's the first time I  
heard that - it sounds like there are some negative cononations with  
that - true?

> The other thing is that, since you're really using a stub (i.e. the
> verification is that the right stuff shows up in the tags), you could
> use OpenStruct:
> require 'ostruct'
> context "...." do
>   specify "..." do
>     @u1 = OpenStruct.new(:name => "jcfischer", :etc => "otherstuff")
>   end
>   ...
> Hope that helps.

that helps a lot - thanks!

More information about the rspec-devel mailing list