On Thu, Jan 27, 2011 at 8:39 PM, Marnen Laibow-Koser
<[email protected]>wrote:

> David Kahn wrote in post #978011:
> > On Thu, Jan 27, 2011 at 4:01 PM, William Fisk
> > <[email protected]>wrote:
> >
> >> Ah, thanks, yes that will probably be the reason.
> >
> >
> > Right... send comes in real handy in testing private methods, use it all
> > the
> > time
>
> Then you've got bigger problems.  You shouldn't be testing your private
> methods; that's poking too deeply into an object's implementation.  You
> should only ever test things that can be called from outside an object.
>
> If a private method is an intermediate value in a computation, just test
> the end result.  If a private method really needs to be tested
> separately, then it's telling you that it wants to be public.
>

I disagree -- for me public is what I want to expose to outside access,
regardless of complexity or size, where the private logic may actually be
the most complex, being called by a relatively light public function. Now
this may be a difference between TDD and BDD in pure forms, but for me I
find if I drive my methods, public or private with test first, that the end
resulting code is much more pliable. Also, if I have coverage on what
becomes complex private logic, at a more granular level -- then I have a
much stronger project an also address minute issues closer to the source. I
am sure you have your method of working that works for you, this is what I
have found effective and successful.

>
> Best,
> --
> Marnen Laibow-Koser
> http://www.marnen.org
> [email protected]
>
> Sent from my iPhone
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en.

Reply via email to