On Dec 12, 2008, at 6:57 pm, Martin Gamsjaeger wrote:

> Sorry I can't really help you with your problem, but I can tell you
> that mocking is frowned upon in the merb community, mainly because it
> can lead to very brittle tests where you tend to only test your
> implementation and not the "real output" of your program.

Hmmm, I've been here before :)  David Chelimsky recently answered this  
much better than I can[1], and I share his sentiments entirely.


> That said, what about just issuing a request to your controller and
> then test the returned view if it include some CSS3 selector you
> expect it to have?


I use Cucumber to drive my app through its external (HTML/HTTP)  
interface, and therefore I have a set of entirely mock-free tests that  
work only by inspect the publicly-visible output.  To do this again in  
the controller would be wasteful duplication.

What I want out of the controller specs is to check only that they do  
the appropriate things with the parameters, models and views.   
Controllers are trivial objects that don't do much more than hide the  
web-based nature of the app from the model layer, so I don't want to  
emphasise them in my spec suite.


But back to the problem at hand, am I right in thinking that this  
behaviour of #assigns is a bug?


Thanks
Ashley


[1] 
http://blog.davidchelimsky.net/2008/12/11/a-case-against-a-case-against-mocking-and-stubbing


-- 
http://www.patchspace.co.uk/
http://aviewfromafar.net/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to