[rspec-users] Testing initialize methods and chained methods

Oscar Del Ben thehcdreamer at gmail.com
Wed Oct 20 02:55:21 EDT 2010


Thanks for all the replies and the help.

On Tue, Oct 19, 2010 at 9:08 PM, David Chelimsky <dchelimsky at gmail.com>wrote:

> On Oct 19, 2010, at 2:04 PM, Pat Maddox wrote:
>
> > On Oct 19, 2010, at 12:56 AM, Oscar Del Ben wrote:
> >
> >> I'm having some troubles understanding how to test a couple of things.
> Usually, if I'm having trouble testing something, it means that my design
> could probably be improved or changed, but in these cases I think I'm doing
> the right thing.
> >>
> >> Here's the first scenario:
> >>
> >> class Foo
> >>  def initialize
> >>    do_something
> >>  end
> >> end
> >>
> >> Here I have no idea how to test that the do_something method is called.
> >
> > What are the post-conditions of do_something?  Check for those.
>
> Think "outcomes" as opposed to "post-conditions", which means something
> very specific (and subtly different) in the context of Design by Contract.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>



-- 
Oscar Del Ben

http://oscardelben.com
http://freestylemind.com/
http://twitter.com/oscardelben
http://facebook.com/freestylemind
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20101020/5f1437b5/attachment.html>


More information about the rspec-users mailing list