[rspec-users] Depot app, Demeter's law and troubles cleanly spe cing

Zach Dennis zach.dennis at gmail.com
Thu Apr 23 14:23:11 EDT 2009


On Thu, Apr 23, 2009 at 2:19 PM, Fernando Perez <lists at ruby-forum.com> wrote:
> Rails definitely entices you to break Demeter's law just so often.
>
> Now how to cleanly spec:
>
> @comment = @article.comments.build(params[:comment]) ?

You think that's bad, I've seen many a code that looks like:

project.tasks.map(&:responsible_party).group_by{ ... }.map....sort

>
> Mocking and stubbing is starting to get ugly now.
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>



-- 
Zach Dennis
http://www.continuousthinking.com (personal)
http://www.mutuallyhuman.com (hire me)
@zachdennis (twitter)


More information about the rspec-users mailing list