[rspec-users] should_receive(:x).at_most/exactly... ignored when method is previously stubbed?

2009-12-01 Thread Lenny Marks
I've always used the idiom of stub collaborations in a before block and then focus in specific examples with should_receive. (e.g. should_receive takes presence over stub). I was just attempting to write an example for caching behavior and ran into something counter- intuitive, at least

Re: [rspec-users] should_receive(:x).at_most/exactly... ignored when method is previously stubbed?

2009-12-01 Thread Lenny Marks
Forgot to mention: rspec 1.2.9 On Dec 1, 2009, at 11:46 AM, Lenny Marks wrote: I've always used the idiom of stub collaborations in a before block and then focus in specific examples with should_receive. (e.g. should_receive takes presence over stub). I was just attempting to write an

Re: [rspec-users] should_receive(:x).at_most/exactly... ignored when method is previously stubbed?

2009-12-01 Thread Ashley Moran
On Dec 01, 2009, at 4:46 pm, Lenny Marks wrote: This seems dangerous to me. Assuming I hadn't initially stubbed in the before block and everything worked as expected, if someone later stubs :lookup in the before block because they are adding new examples that don't care about it, my

Re: [rspec-users] should_receive(:x).at_most/exactly... ignored when method is previously stubbed?

2009-12-01 Thread Lenny Marks
On Dec 1, 2009, at 1:24 PM, Ashley Moran wrote: On Dec 01, 2009, at 4:46 pm, Lenny Marks wrote: This seems dangerous to me. Assuming I hadn't initially stubbed in the before block and everything worked as expected, if someone later stubs :lookup in the before block because they are

Re: [rspec-users] should_receive(:x).at_most/exactly... ignored when method is previously stubbed?

2009-12-01 Thread Ashley Moran
On Dec 01, 2009, at 7:34 pm, Lenny Marks wrote: Thanks Ashley. I added my 2 cents to the ticket. Just had a look over your comments. It's a complicated issue... I hope David can reconcile it. I'm not sure what the best solution is. Ashley -- http://www.patchspace.co.uk/