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

2008-10-30 Thread Sebastian W.
Hi Scott, Cool - I see what you're saying here. The only thing that I'm a bit confused still is that it seems like, at least if your system is starting to get larger, you'd really *want* your fast unit test to help you catch API changes like this to help you make updates faster. Having to run

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

2008-10-30 Thread Scott Taylor
On Oct 30, 2008, at 2:01 AM, Sebastian W. wrote: Hi Scott, Cool - I see what you're saying here. The only thing that I'm a bit confused still is that it seems like, at least if your system is starting to get larger, you'd really *want* your fast unit test to help you catch API changes like

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

2008-10-30 Thread David Chelimsky
On Thu, Oct 30, 2008 at 1:14 AM, Scott Taylor [EMAIL PROTECTED] wrote: On Oct 30, 2008, at 2:01 AM, Sebastian W. wrote: Hi Scott, Cool - I see what you're saying here. The only thing that I'm a bit confused still is that it seems like, at least if your system is starting to get larger,

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

2008-10-30 Thread Scott Taylor
On Oct 30, 2008, at 2:14 AM, Scott Taylor wrote: On Oct 30, 2008, at 2:01 AM, Sebastian W. wrote: Hi Scott, Cool - I see what you're saying here. The only thing that I'm a bit confused still is that it seems like, at least if your system is starting to get larger, you'd really *want* your

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

2008-10-30 Thread Sebastian W.
Why don't we have a partial mock which will raise an error (or at least a warning) when stubbing an object who's class doesn't respond_to? the method given? I feel like this sort of simple dependency has been brought up 1000 times on the list before, but never been explicitly stated.

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

2008-10-30 Thread Scott Taylor
On Oct 30, 2008, at 2:17 AM, David Chelimsky wrote: On Thu, Oct 30, 2008 at 1:14 AM, Scott Taylor [EMAIL PROTECTED] wrote: On Oct 30, 2008, at 2:01 AM, Sebastian W. wrote: Hi Scott, Cool - I see what you're saying here. The only thing that I'm a bit confused still is that it seems like, at

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

2008-10-30 Thread Scott Taylor
On Oct 30, 2008, at 2:17 AM, David Chelimsky wrote: On Thu, Oct 30, 2008 at 1:14 AM, Scott Taylor [EMAIL PROTECTED] wrote: On Oct 30, 2008, at 2:01 AM, Sebastian W. wrote: Hi Scott, Cool - I see what you're saying here. The only thing that I'm a bit confused still is that it seems like, at

[rspec-users] mocking does not work

2008-10-30 Thread Leon Du
The spec it should expose a newly created logo as @logo do Logo.should_receive(:new).with({'these' = 'params'}).and_return(mock_logo(:save =

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 even

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

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] 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:

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] 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:

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 features within both

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 0% test coverage.

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

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 controllers, but testing

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? Nope, I'm trying to teach

[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

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! Ended

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 desc)

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 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_dt_appl_prod

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 =

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

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] 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, is that

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

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 an organization that

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 I'd

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 concrete examples

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

[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

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

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

[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] 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,

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