Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread Jarkko Laine
On 10.9.2008, at 0.29, Zach Dennis wrote: I don't think this works as you may expect since My SQL and PostgreSQL don't support nested transactions, which is what would happen if your test environment wrapped stories/scenarios in transactions and your application utilized transactions. I've been

Re: [rspec-users] RSpec sundry questions

2008-09-09 Thread Mikel Lindsaar
On Wed, Sep 3, 2008 at 7:05 AM, Greg Hauptmann <[EMAIL PROTECTED]> wrote: > Q2 - Anyone know where the "build" method that Ryan used in his Rails > cast? Was this a mocha method? (I couldn't see it in the api). > Reference: http://railscasts.com/episodes/81-fixtures-in-rails-2-0 No, I skimmed th

Re: [rspec-users] cucumber - mark a step as pending

2008-09-09 Thread Pat Maddox
"aslak hellesoy" <[EMAIL PROTECTED]> writes: > On Tue, Sep 9, 2008 at 7:16 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: >> Aslak - I think Matt is looking for this: >> >> Given /blah/ do >> pending >> end >> > > I'm not crazy about this "feature". We already have a pending > mechanism for steps

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread Jim Morris
Sam Stokes wrote: It seems to me that with "Given an existing post 'lol internet'" # creates a post with that title "Then the page should include 'lol internet'" # assumes a post with that title the assumptions are in line with what you'd naturally understand from the English, whereas "Gi

Re: [rspec-users] Cucumber and fixtures/FixtureReplacement

2008-09-09 Thread Scott Taylor
On Sep 9, 2008, at 2:58 PM, Tim Glen wrote: Did you see that my code uses extend? Yes - tried both in my flailing about :) If that still doesn't work, file a bug report. http://rspec.lighthouseapp.com/projects/16211-cucumber/overview It might be a FixtureReplacement bug, but I'll still loo

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread Sam Stokes
Thanks everyone for your responses - this is a really helpful discussion and every post has added to my understanding. Thanks also for disagreeing with each other, as it makes me feel less stupid for asking the question :) Jim Morris wrote: > Ok I think I see the difference, by the state being

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread Jim Morris
aslak hellesoy wrote: There is persistent state (database) and object state (the object that serves as a context for a scenario). I'm not saying that state in and of itself is bad. However, *coupling* is bad - for maintenance reasons. If the steps share object state (in @variables) they become

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread Zach Dennis
On Tue, Sep 9, 2008 at 3:52 PM, Matt Wynne <[EMAIL PROTECTED]> wrote: > > On 9 Sep 2008, at 19:52, Jim Morris wrote: > >> aslak hellesoy wrote: >> >>> The debate seems to be whether step definitions should be stateful or >>> not. >>> In practice this is achieved by setting one or more @variables in

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread Jim Morris
Thanks for the hints, but I think I did point out I am not using Rails, I write Integration tests, that talk directly to the web application via HTTP running the full stack. So Active record is not available neither are transactions for the database. Sorry for the confusion. If I were using Ra

Re: [rspec-users] cucumber - mark a step as pending

2008-09-09 Thread Matt Wynne
On 9 Sep 2008, at 21:34, aslak hellesoy wrote: On Tue, Sep 9, 2008 at 8:46 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: On Tue, Sep 9, 2008 at 12:47 PM, aslak hellesoy <[EMAIL PROTECTED]> wrote: On Tue, Sep 9, 2008 at 7:16 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: Aslak - I think Mat

Re: [rspec-users] cucumber - mark a step as pending

2008-09-09 Thread aslak hellesoy
On Tue, Sep 9, 2008 at 8:46 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Tue, Sep 9, 2008 at 12:47 PM, aslak hellesoy > <[EMAIL PROTECTED]> wrote: >> On Tue, Sep 9, 2008 at 7:16 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: >>> Aslak - I think Matt is looking for this: >>> >>> Given /blah/

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread aslak hellesoy
On Tue, Sep 9, 2008 at 8:52 PM, Jim Morris <[EMAIL PROTECTED]> wrote: > aslak hellesoy wrote: > >> The debate seems to be whether step definitions should be stateful or not. >> In practice this is achieved by setting one or more @variables in a >> step and reusing them in a different step - all wit

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread Matt Wynne
On 9 Sep 2008, at 19:52, Jim Morris wrote: aslak hellesoy wrote: The debate seems to be whether step definitions should be stateful or not. In practice this is achieved by setting one or more @variables in a step and reusing them in a different step - all within a scenario. I think that i

Re: [rspec-users] Cucumber and fixtures/FixtureReplacement

2008-09-09 Thread Aslak Hellesøy
Did you see that my code uses extend? Yes - tried both in my flailing about :) If that still doesn't work, file a bug report. http://rspec.lighthouseapp.com/projects/16211-cucumber/overview It might be a FixtureReplacement bug, but I'll still look into it. Could it be that FixtureReplacem

Re: [rspec-users] Cucumber and fixtures/FixtureReplacement

2008-09-09 Thread Tim Glen
Did you see that my code uses extend? Yes - tried both in my flailing about :) If that still doesn't work, file a bug report. http://rspec.lighthouseapp.com/projects/16211-cucumber/overview It might be a FixtureReplacement bug, but I'll still look into it. Could it be that FixtureReplacemen

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread Jim Morris
aslak hellesoy wrote: The debate seems to be whether step definitions should be stateful or not. In practice this is achieved by setting one or more @variables in a step and reusing them in a different step - all within a scenario. I think that is the debate, but I'd like to point out that th

Re: [rspec-users] What does a skilled BDD-/RSpec-er want in a job?

2008-09-09 Thread Ashley Moran
On Sep 09, 2008, at 3:00 pm, David Chelimsky wrote: Sorry man, to get us you're going to have to talk about vegetables and Features. Actually I'm going to be giving a short talk on BDD story/feature writing + Cucumber + RSpec + Celerity at my next local monthly mini- conference/geek beer-

Re: [rspec-users] cucumber - mark a step as pending

2008-09-09 Thread David Chelimsky
On Tue, Sep 9, 2008 at 12:47 PM, aslak hellesoy <[EMAIL PROTECTED]> wrote: > On Tue, Sep 9, 2008 at 7:16 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: >> Aslak - I think Matt is looking for this: >> >> Given /blah/ do >> pending >> end >> > > I'm not crazy about this "feature". We already have a

Re: [rspec-users] Cucumber and fixtures/FixtureReplacement

2008-09-09 Thread Tim Glen
Before do self.extend(FixtureReplacement) end I had previously tried this right in the steps file: Before do self.include(FixtureReplacement) end Actually - this turned out to almost the right thing. I just added this to my env.rb: `include FixtureReplacement` Wrapping it in the Before bl

Re: [rspec-users] Cucumber and fixtures/FixtureReplacement

2008-09-09 Thread aslak hellesoy
On Tue, Sep 9, 2008 at 8:20 PM, Tim Glen <[EMAIL PROTECTED]> wrote: >> On Tue, Sep 9, 2008 at 7:45 PM, Matt Wynne <[EMAIL PROTECTED]> wrote: >>> >>> Remember these things should use transactions, and may do that by default >>> - >>> the database will be wiped clean once the features have run. >>> >

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread aslak hellesoy
On Tue, Sep 9, 2008 at 8:28 PM, Jim Morris <[EMAIL PROTECTED]> wrote: > Dan North wrote: >> >> Hi Jim. >> >> I guess I'm not a purist then - that looks fine to me, and it's probably >> something I would consider doing too. >> > > I'd never call you a purist Dan ;) But I do feel less dirty now, alth

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread Jim Morris
Dan North wrote: Hi Jim. I guess I'm not a purist then - that looks fine to me, and it's probably something I would consider doing too. I'd never call you a purist Dan ;) But I do feel less dirty now, although after reading Aslaks post I wonder what exactly is meant by stateless steps? It

Re: [rspec-users] Cucumber and fixtures/FixtureReplacement

2008-09-09 Thread Tim Glen
On Tue, Sep 9, 2008 at 7:45 PM, Matt Wynne <[EMAIL PROTECTED]> wrote: Remember these things should use transactions, and may do that by default - the database will be wiped clean once the features have run. sorry - I wasn't trying to say that the database is empty after the scenarios are r

Re: [rspec-users] cucumber - mark a step as pending

2008-09-09 Thread Matt Wynne
It's by design, but I'm open for suggestions. David created a similar ticket yesterday: http://rspec.lighthouseapp.com/projects/16211/tickets/8-all-steps- after-a-failure-are-listed-as-skipped#ticket-8-1 Currently, only a failure (red) will cause subsequent steps to be skipped. In case I've

Re: [rspec-users] Cucumber and fixtures/FixtureReplacement

2008-09-09 Thread aslak hellesoy
On Tue, Sep 9, 2008 at 7:45 PM, Matt Wynne <[EMAIL PROTECTED]> wrote: > Remember these things should use transactions, and may do that by default - > the database will be wiped clean once the features have run. > FWIW, When Cucumber is used with Rails it runs all scenarios in a transaction. I hav

Re: [rspec-users] cucumber - mark a step as pending

2008-09-09 Thread aslak hellesoy
On Tue, Sep 9, 2008 at 7:52 PM, Matt Wynne <[EMAIL PROTECTED]> wrote: > Yeah the trouble is it fails with the following error: > > Spec::Example::ExamplePendingError > > Which cucumber doesn't understand as anything other than a complete fail. > > Our workaround we've arrived at (thanks Aslak for p

Re: [rspec-users] cucumber - mark a step as pending

2008-09-09 Thread Matt Wynne
Yeah the trouble is it fails with the following error: Spec::Example::ExamplePendingError Which cucumber doesn't understand as anything other than a complete fail. Our workaround we've arrived at (thanks Aslak for pointing out the obvious that we'd missed!) is to just write PENDING at the

Re: [rspec-users] cucumber - mark a step as pending

2008-09-09 Thread aslak hellesoy
On Tue, Sep 9, 2008 at 7:16 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > Aslak - I think Matt is looking for this: > > Given /blah/ do > pending > end > I'm not crazy about this "feature". We already have a pending mechanism for steps (not defining them). What does this bring to the table ove

Re: [rspec-users] Cucumber and fixtures/FixtureReplacement

2008-09-09 Thread Matt Wynne
Remember these things should use transactions, and may do that by default - the database will be wiped clean once the features have run. On 9 Sep 2008, at 18:22, Tim Glen wrote: Hey guys, I'd never used RSpec Stories before, so I decided to follow the apparent direction of the wind and jus

[rspec-users] Cucumber and fixtures/FixtureReplacement

2008-09-09 Thread Tim Glen
Hey guys, I'd never used RSpec Stories before, so I decided to follow the apparent direction of the wind and just jump right into cucumber. I'm dabbling with/using Cucumber and really like it. Good job, aslak! Where i'm struggling right now is using either fixtures or a model factory meth

Re: [rspec-users] cucumber - mark a step as pending

2008-09-09 Thread David Chelimsky
Aslak - I think Matt is looking for this: Given /blah/ do pending end Matt - I'm pretty sure that will work - give it a shot, OK? On Tue, Sep 9, 2008 at 12:09 PM, Aslak Hellesøy <[EMAIL PROTECTED]> wrote: > A plain text step with no matching step definition is pending. > > Sent from my iPhone

Re: [rspec-users] cucumber - mark a step as pending

2008-09-09 Thread Aslak Hellesøy
A plain text step with no matching step definition is pending. Sent from my iPhone On 9. sep.. 2008, at 19.05, "David Chelimsky" <[EMAIL PROTECTED]> wrote: Have you tried? On Tue, Sep 9, 2008 at 12:01 PM, Matt Wynne <[EMAIL PROTECTED]> wrote: I love the way I can throw a call to pending(

Re: [rspec-users] cucumber - mark a step as pending

2008-09-09 Thread David Chelimsky
Have you tried? On Tue, Sep 9, 2008 at 12:01 PM, Matt Wynne <[EMAIL PROTECTED]> wrote: > I love the way I can throw a call to pending() in the top of an unfinished > RSpec example and stop it from failing the build. > Is there a similar way to do such a thing with good ole' cucumber? > > cheers, >

[rspec-users] cucumber - mark a step as pending

2008-09-09 Thread Matt Wynne
I love the way I can throw a call to pending() in the top of an unfinished RSpec example and stop it from failing the build. Is there a similar way to do such a thing with good ole' cucumber? cheers, Matt http://blog.mattwynne.net http://songkick.com In case you wondered: The opinions ex

Re: [rspec-users] backslash in story runner scenario

2008-09-09 Thread David Chelimsky
Please post bugs to http://rspec.lighthouseapp.com. Thanks, David On Tue, Sep 9, 2008 at 11:58 AM, aidy lewis <[EMAIL PROTECTED]> wrote: > Hi, > > If a backslash is put into a story runner scenario > > Scenario: Message is sent >Given an order has been created >When I goto the purchased

[rspec-users] backslash in story runner scenario

2008-09-09 Thread aidy lewis
Hi, If a backslash is put into a story runner scenario Scenario: Message is sent Given an order has been created When I goto the purchased screen And something with a \ breaks it then this exception is created c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.1.4/lib/spec/story/world.rb:63:i

Re: [rspec-users] scenarios on production data

2008-09-09 Thread Matt Wynne
On 9 Sep 2008, at 14:54, Ashley Moran wrote: On 8 Sep 2008, at 17:21, Jonathan Linowes wrote: Here's one example: lets say my app is a specialized CMS, where account owners can setup their own projects, pages and forms. I'd like to run scenarios against setups that users have created. T

Re: [rspec-users] What does a skilled BDD-/RSpec-er want in a job?

2008-09-09 Thread David Chelimsky
On Tue, Sep 9, 2008 at 8:34 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > On 9 Sep 2008, at 13:28, Dan North wrote: > >> I know a while back Google used to request python skills when they were >> hiring java folks. They didn't actually need python to do their job - it >> just meant they attracted t

Re: [rspec-users] scenarios on production data

2008-09-09 Thread Ashley Moran
On 8 Sep 2008, at 17:21, Jonathan Linowes wrote: Here's one example: lets say my app is a specialized CMS, where account owners can setup their own projects, pages and forms. I'd like to run scenarios against setups that users have created. Thinking further, wouldn't it be neat to make thi

Re: [rspec-users] What does a skilled BDD-/RSpec-er want in a job?

2008-09-09 Thread Ashley Moran
On 9 Sep 2008, at 13:28, Dan North wrote: I know a while back Google used to request python skills when they were hiring java folks. They didn't actually need python to do their job - it just meant they attracted the kind of developers who venture outside their regular programming world, wh

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread aslak hellesoy
On Tue, Sep 9, 2008 at 2:21 PM, Dan North <[EMAIL PROTECTED]> wrote: > Hi Jim. > > I guess I'm not a purist then - that looks fine to me, and it's probably > something I would consider doing too. > > The thing to bear in mind is that there is magic going on when you run > steps. Each step in a scen

Re: [rspec-users] What does a skilled BDD-/RSpec-er want in a job?

2008-09-09 Thread Dan North
I know a while back Google used to request python skills when they were hiring java folks. They didn't actually need python to do their job - it just meant they attracted the kind of developers who venture outside their regular programming world, which is what they were really after. Mind you they

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread Dan North
Hi Jim. I guess I'm not a purist then - that looks fine to me, and it's probably something I would consider doing too. The thing to bear in mind is that there is magic going on when you run steps. Each step in a scenario is run in the context of the same object instance (which you don't get to se