2009/4/24 Stephen Eley sfe...@gmail.com
On Thu, Apr 23, 2009 at 2:19 PM, Fernando Perez li...@ruby-forum.com
wrote:
[...]
# Assume an article with no comments and a params structure
# have already been set up in before(:each)
it should make a new comment belonging to the article do
On Sun, Apr 26, 2009 at 9:20 PM, Dan North tasta...@gmail.com wrote:
2009/4/24 Stephen Eley sfe...@gmail.com
On Thu, Apr 23, 2009 at 2:19 PM, Fernando Perez li...@ruby-forum.com
wrote:
[...]
# Assume an article with no comments and a params structure
# have already been set up in
On Sun, Apr 26, 2009 at 10:20 PM, Dan North tasta...@gmail.com wrote:
2009/4/24 Stephen Eley sfe...@gmail.com
Yeah, I'm a smartass.
Well you seem to be on the right lines to me.
Thank you! That means a great deal to me.
--
Have Fun,
Steve Eley (sfe...@gmail.com)
ESCAPE POD - The
Rails definitely entices you to break Demeter's law just so often.
Now how to cleanly spec:
@comment = @article.comments.build(params[:comment]) ?
Mocking and stubbing is starting to get ugly now.
--
Posted via http://www.ruby-forum.com/.
___
On Thu, Apr 23, 2009 at 2:19 PM, Fernando Perez li...@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:
On Thu, Apr 23, 2009 at 2:19 PM, Fernando Perez li...@ruby-forum.com wrote:
Rails definitely entices you to break Demeter's law just so often.
So fix it. It's usually just a matter of putting in some delegators.
If you don't like @article.comments.build, you can declare your own
On Apr 21, 2009, at 9:45 AM, Steve Schafer wrote:
On Mon, 20 Apr 2009 12:40:08 -0700, you wrote:
I wrote a blog post that may be helpful.
http://www.patmaddox.com/blog/demeter-is-for-encapsulation
Basically,
when you have structural objects as in this case, demeter isn't
useful.
I
On Mon, 20 Apr 2009 12:40:08 -0700, you wrote:
I wrote a blog post that may be helpful.
http://www.patmaddox.com/blog/demeter-is-for-encapsulation Basically,
when you have structural objects as in this case, demeter isn't
useful.
That's a good example as far as it goes, but I think it makes a