Re: [rspec-users] spec'ing the :conditions argument of a find

2008-10-30 Thread Zach Dennis
On Thu, Oct 30, 2008 at 12:41 PM, Matt Wynne <[EMAIL PROTECTED]> wrote: > On 30 Oct 2008, at 15:58, Zach Dennis wrote: > >> I know the above example breaks the one assertion per test guideline >> people strive to adhere to, but I think it is ok. If there are more >> examples that should be used t

Re: [rspec-users] Working outside-in with Cucumber and RSpec

2008-10-30 Thread Ashley Moran
On 30 Oct 2008, at 13:46, David Chelimsky wrote: I'd agree with this (in spite of my previous comments), and add to it. One of the benefits of writing examples is that they actually help to expose things that are growing complex. If it's hard to test, it's probably hard to change. Aslak made

Re: [rspec-users] Mocks and Refactoring - doing it wrong?

2008-10-30 Thread Scott Taylor
On Oct 30, 2008, at 7:52 PM, Sebastian W. wrote: No idea why you couldn't pass a flag for regression testing: mock(Foo, :check_methods => true) Scott It seems to me this way, too - though I'm obviously biased. :) It's true that a lot of the dynamic stuff could be problematic - what if t

Re: [rspec-users] Help: Attempts to run specs quitting midstream

2008-10-30 Thread Scott Taylor
On Oct 30, 2008, at 8:21 PM, Evan Dorn wrote: I am having a very frustrating problem running specs on my current project. When I run tests en masse with "rake spec" or with autotest, it frequently quits without completing all the tests. It also sometimes runs the tests in multiple batches, g

[rspec-users] Help: Attempts to run specs quitting midstream

2008-10-30 Thread Evan Dorn
I am having a very frustrating problem running specs on my current project. When I run tests en masse with "rake spec" or with autotest, it frequently quits without completing all the tests. It also sometimes runs the tests in multiple batches, giving more than one result line for a single batch

Re: [rspec-users] Mocks and Refactoring - doing it wrong?

2008-10-30 Thread Sebastian W.
> No idea why you couldn't pass a flag for regression testing: > > mock(Foo, :check_methods => true) > > Scott It seems to me this way, too - though I'm obviously biased. :) It's true that a lot of the dynamic stuff could be problematic - what if the flag was only for checking methods directly

Re: [rspec-users] stub followed by should_receive behavior changed

2008-10-30 Thread Pat Maddox
You're right, the behavior did change. Now when you have a should_receive that shadows a previous stub, it returns or yields the original value. I don't know a way to turn off the yielding in the should_receive, I'll look at putting something in. In the mean time, if you stub the method again with

[rspec-users] stub followed by should_receive behavior changed

2008-10-30 Thread Lenny Marks
I'm in the process of trying to get updated to rspec-1.1.11(from 1.1.1). I have a couple of places where I was trying to verify that a particular collaboration was made inside a transaction. My general strategy was to start off using something like Transaction.stub! (:execute).and_yield in a

Re: [rspec-users] Mocks and Refactoring - doing it wrong?

2008-10-30 Thread Scott Taylor
On Oct 30, 2008, at 4:05 PM, Pat Maddox wrote: Scott Taylor <[EMAIL PROTECTED]> writes: Actually, I take back my previous comment. Where would you stub a method on an object where the method *isn't* even loaded by further (or previous) stubbing? Any concrete examples come to mind? How abo

Re: [rspec-users] Mocks and Refactoring - doing it wrong?

2008-10-30 Thread Scott Taylor
On Oct 30, 2008, at 4:05 PM, Pat Maddox wrote: Scott Taylor <[EMAIL PROTECTED]> writes: Actually, I take back my previous comment. Where would you stub a method on an object where the method *isn't* even loaded by further (or previous) stubbing? Any concrete examples come to mind? How abo

Re: [rspec-users] Mocks and Refactoring - doing it wrong?

2008-10-30 Thread David Chelimsky
On Thu, Oct 30, 2008 at 3:05 PM, Pat Maddox <[EMAIL PROTECTED]> wrote: > Scott Taylor <[EMAIL PROTECTED]> writes: > >> Actually, I take back my previous comment. Where would you stub a >> method on an object where the method *isn't* even loaded by further >> (or previous) stubbing? >> >> Any concr

Re: [rspec-users] spec'ing the :conditions argument of a find

2008-10-30 Thread Pat Maddox
Matt Wynne <[EMAIL PROTECTED]> writes: > On 30 Oct 2008, at 15:58, Zach Dennis wrote: >> I know the above example breaks the one assertion per test guideline >> people strive to adhere to, but I think it is ok. If there are more >> examples that should be used to make sure find_thingy works then

Re: [rspec-users] Mocks and Refactoring - doing it wrong?

2008-10-30 Thread Pat Maddox
Scott Taylor <[EMAIL PROTECTED]> writes: > Actually, I take back my previous comment. Where would you stub a > method on an object where the method *isn't* even loaded by further > (or previous) stubbing? > > Any concrete examples come to mind? How about if you haven't implemented that object ye

Re: [rspec-users] After a step fails, if successive steps have been executed and passed, cucumber reports them as skipped

2008-10-30 Thread David Chelimsky
On Thu, Oct 30, 2008 at 2:18 PM, Stephen Eley <[EMAIL PROTECTED]> wrote: > On Thu, Oct 30, 2008 at 12:07 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: >> >> This is absolutely by design. If a step passes or fails after another >> has failed, you have no way of knowing if it would still pass or fai

Re: [rspec-users] Working outside-in with Cucumber and RSpec

2008-10-30 Thread Pat Maddox
"David Chelimsky" <[EMAIL PROTECTED]> writes: > On Thu, Oct 30, 2008 at 5:20 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: >> On 27 Oct 2008, at 16:35, Pat Maddox wrote: >> >>> Matt Wynne <[EMAIL PROTECTED]> writes: >>> Pat - are you going solo too? >>> >>> Nope, I'm trying to teach RSpec/BDD to

Re: [rspec-users] After a step fails, if successive steps have been executed and passed, cucumber reports them as skipped

2008-10-30 Thread Stephen Eley
On Thu, Oct 30, 2008 at 12:07 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > > This is absolutely by design. If a step passes or fails after another > has failed, you have no way of knowing if it would still pass or fail > once the other one is passing. Cucumber reports the first problem in a > s

Re: [rspec-users] After a step fails, if successive steps have been executed and passed, cucumber reports them as skipped

2008-10-30 Thread David Chelimsky
On Thu, Oct 30, 2008 at 12:02 PM, aidy lewis <[EMAIL PROTECTED]> wrote: > Hi, > > I have a Given step that fails: For that Scenario the remaining > Given's, When, and Then's are reported as being skipped, even though > theses steps have been executed. > > Why I am not submitting this to Lighthouse,

[rspec-users] After a step fails, if successive steps have been executed and passed, cucumber reports them as skipped

2008-10-30 Thread aidy lewis
Hi, I have a Given step that fails: For that Scenario the remaining Given's, When, and Then's are reported as being skipped, even though theses steps have been executed. Why I am not submitting this to Lighthouse, is that I believe, this may be intentional design. However, would it not be more i

Re: [rspec-users] spec'ing the :conditions argument of a find

2008-10-30 Thread Matt Wynne
On 30 Oct 2008, at 15:58, Zach Dennis wrote: I know the above example breaks the one assertion per test guideline people strive to adhere to, but I think it is ok. If there are more examples that should be used to make sure find_thingy works then I'd break out a separate describe block and

Re: [rspec-users] spec'ing the :conditions argument of a find

2008-10-30 Thread Zach Dennis
On Thu, Oct 30, 2008 at 11:41 AM, Rémi Gagnon <[EMAIL PROTECTED]> wrote: > I do agree, That's what we're gonna do. it was just an example. > But what if we want to test find_thingy(in model spec) to make sure the > :conditions is set properly? You are probably more interested in the fact that fi

Re: [rspec-users] spec'ing the :conditions argument of a find

2008-10-30 Thread Rémi Gagnon
I do agree, That's what we're gonna do. it was just an example. But what if we want to test find_thingy(in model spec) to make sure the :conditions is set properly? R Pat Maddox wrote: > Rémi Gagnon <[EMAIL PROTECTED]> writes: > >> Product.should_receive(:find).with(:conditions => >> 'vaat_id_t

Re: [rspec-users] spec'ing the :conditions argument of a find

2008-10-30 Thread Pat Maddox
Rémi Gagnon <[EMAIL PROTECTED]> writes: > Let's see, I want to spec the :conditions args to make sure the right > args is passed to the query. > > Product.find(:all, > :conditions => ["inte_no = ? and vaat_id_type_statut_pcpa = ?", > inte_no, 7], > :limit => 2, > :order => "trns_

Re: [rspec-users] Mailing list playing catch up with anyone else?

2008-10-30 Thread Nick Hoffman
On 2008-10-30, at 10:56, Zach Dennis wrote: Last night it seemed like the mailing list was playing catchup, as I got a flood of emails from the past few days. Has anyone else seen this? Yup! When I checked my email this morning, I found 61 new messages from the rspec-users ML. ___

Re: [rspec-users] spec'ing the :conditions argument of a find

2008-10-30 Thread Nick Hoffman
On 2008-10-28, at 10:52, Rémi Gagnon wrote: Let's see, I want to spec the :conditions args to make sure the right args is passed to the query. Product.find(:all, :conditions => ["inte_no = ? and vaat_id_type_statut_pcpa = ?", inte_no, 7], :limit => 2, :order => "trns_dt_appl_prod

Re: [rspec-users] Mailing list playing catch up with anyone else?

2008-10-30 Thread David Chelimsky
On Thu, Oct 30, 2008 at 9:56 AM, Zach Dennis <[EMAIL PROTECTED]> wrote: > Last night it seemed like the mailing list was playing catchup, as I got a > flood of emails from the past few days. Has anyone else seen this? Yep. Right in the middle of trying to wrap up a chapter in the rspec book! Ende

[rspec-users] Mailing list playing catch up with anyone else?

2008-10-30 Thread Zach Dennis
Last night it seemed like the mailing list was playing catchup, as I got a flood of emails from the past few days. Has anyone else seen this? -- Zach Dennis http://www.continuousthinking.com http://www.mutuallyhuman.com ___ rspec-users mailing list rspe

Re: [rspec-users] Working outside-in with Cucumber and RSpec

2008-10-30 Thread Zach Dennis
On Thu, Oct 30, 2008 at 9:46 AM, David Chelimsky <[EMAIL PROTECTED]>wrote: > On Thu, Oct 30, 2008 at 5:20 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: > > On 27 Oct 2008, at 16:35, Pat Maddox wrote: > > > >> Matt Wynne <[EMAIL PROTECTED]> writes: > >> > >>> Pat - are you going solo too? > >> > >> Nop

Re: [rspec-users] Working outside-in with Cucumber and RSpec

2008-10-30 Thread David Chelimsky
On Thu, Oct 30, 2008 at 9:47 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: >> Aslak made a good point earlier this thread with "don't write specs >> just cuz," but perhaps this fact is sufficient "cuz" to motivate. >> >> WDYT? > > There's something else here (nothing to do with testing rails controller

Re: [rspec-users] Working outside-in with Cucumber and RSpec

2008-10-30 Thread Matt Wynne
Aslak made a good point earlier this thread with "don't write specs just cuz," but perhaps this fact is sufficient "cuz" to motivate. WDYT? There's something else here (nothing to do with testing rails controllers, but testing in general) about the psychological blockage to working up the t

Re: [rspec-users] Working outside-in with Cucumber and RSpec

2008-10-30 Thread David Chelimsky
On Thu, Oct 30, 2008 at 5:20 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: > On 27 Oct 2008, at 16:35, Pat Maddox wrote: > >> Matt Wynne <[EMAIL PROTECTED]> writes: >> >>> Pat - are you going solo too? >> >> Nope, I'm trying to teach RSpec/BDD to an organization that currently >> doesn't use it and has

Re: [rspec-users] Mocks and Refactoring - doing it wrong?

2008-10-30 Thread Matt Wynne
I'd rather have it be a known problem, but a consistent problem, then a partially solved problem that will inevitably cause more pain that it does today :) +1 This is one of the down-sides of working in a dynamic language. We have to suck it up, IMO. Now, here's what I don't understand: sup

Re: [rspec-users] Working outside-in with Cucumber and RSpec

2008-10-30 Thread Matt Wynne
On 27 Oct 2008, at 16:35, Pat Maddox wrote: Matt Wynne <[EMAIL PROTECTED]> writes: Pat - are you going solo too? Nope, I'm trying to teach RSpec/BDD to an organization that currently doesn't use it and has 0% test coverage. It's interesting, to say the least. They're good devs, but even so

Re: [rspec-users] Cucumber step FIT-like tables

2008-10-30 Thread aslak hellesoy
On Tue, Oct 28, 2008 at 11:43 AM, aidy lewis <[EMAIL PROTECTED]> wrote: > Hi Alsak, > > 2008/10/27 Aslak Hellesøy <[EMAIL PROTECTED]>: >> What version/revision? > > I am on 0.1.7; I guess I need to upgrade. If this is the case, will I > need to use the Trunk or is there a gem? > Changelog: http://

Re: [rspec-users] [Cucumber]: require features from mutliple folders

2008-10-30 Thread aslak hellesoy
On Wed, Oct 29, 2008 at 4:39 PM, aidy lewis <[EMAIL PROTECTED]> wrote: > Hi, > > I have different projects with features related to those projects in > different folders > > /project_1 > /project_2 > /steps > > The steps cover both projects > > How do I get Cucumber to require all feature

Re: [rspec-users] mocking does not work

2008-10-30 Thread Leon Du
Thanks for your reply, I did move the code to before before(:each) do Logo.stub!(:new).and_return(mock_logo(:save => true, :company= => nil)) end 2008/10/30 Hans de Graaff <[EMAIL PROTECTED]> > On Thu, 2008-10-30 at 14:47 +0800, Leon Du wrote: > > The spec > > > ---

Re: [rspec-users] mocking does not work

2008-10-30 Thread Hans de Graaff
On Thu, 2008-10-30 at 14:47 +0800, Leon Du wrote: > The spec > > it "should expose a newly created logo as @logo" do > Logo.should_receive(:new)

Re: [rspec-users] Working outside-in with Cucumber and RSpec

2008-10-30 Thread Pat Maddox
Matt Wynne <[EMAIL PROTECTED]> writes: > Pat - are you going solo too? Nope, I'm trying to teach RSpec/BDD to an organization that currently doesn't use it and has 0% test coverage. It's interesting, to say the least. They're good devs, but even so, the effects of not writing tests first (or ev