Re: [rspec-users] Testing initialize methods and chained methods

2010-10-20 Thread Oscar Del Ben
Thanks for all the replies and the help. On Tue, Oct 19, 2010 at 9:08 PM, David Chelimsky 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

Re: [rspec-users] Testing initialize methods and chained methods

2010-10-19 Thread David Chelimsky
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,

Re: [rspec-users] Testing initialize methods and chained methods

2010-10-19 Thread Pat Maddox
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

Re: [rspec-users] Testing initialize methods and chained methods

2010-10-19 Thread Andrew Premdas
Set an expectation that do_something should be called once. Then create a new Foo. With the method chain set an expectation that your chained method should be called, then call the original method. You should be able to check that the original method is passed as a param. Further information in R

Re: [rspec-users] Testing initialize methods and chained methods

2010-10-19 Thread Justin Ko
On Oct 19, 3: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'