Re: [rspec-users] Spec'ing chained calls

2009-03-17 Thread Levy Carneiro Jr.
Thanks for your examples, Chris! regards, Levy On Fri, Mar 13, 2009 at 11:25 AM, Chris Flipse wrote: > You might want to look into using a null object, and breaking that first > spec up into several examples > (a null object returns itself when sent a message it doesn't know how to > handle) >

Re: [rspec-users] Spec'ing chained calls

2009-03-14 Thread Levy Carneiro Jr.
Hello Scott, On Fri, Mar 13, 2009 at 11:59 AM, Scott Taylor wrote: > http://c2.com/cgi/wiki?LawOfDemeter > > Specs are as much of a design tool as a testing tool, and the use of mocks > in your specs show just how ugly the current design is. > > Either write a wrapper around the library which tak

Re: [rspec-users] Spec'ing chained calls

2009-03-13 Thread Scott Taylor
Levy Carneiro Jr. wrote: Hello! I'm trying to spec a method, that has several chained calls. http://gist.github.com/78562 (spec) http://gist.github.com/78563 (model) In the first spec, I'm trying to focus on the method calls that have to be made, and the arguments they should receive. Is th

Re: [rspec-users] Spec'ing chained calls

2009-03-13 Thread Chris Flipse
You might want to look into using a null object, and breaking that first spec up into several examples (a null object returns itself when sent a message it doesn't know how to handle) http://gist.github.com/78570 I've built more than a few named_scope chains using this pattern, and it seems to w

[rspec-users] Spec'ing chained calls

2009-03-13 Thread Levy Carneiro Jr.
Hello! I'm trying to spec a method, that has several chained calls. http://gist.github.com/78562 (spec) http://gist.github.com/78563 (model) In the first spec, I'm trying to focus on the method calls that have to be made, and the arguments they should receive. Is there a better way to spec the