Re: [rspec-users] Before and After blocks for individual feature files?

2009-05-01 Thread Ben Mabey
Korny Sietsma wrote: Celerity is very cool - when it works. It didn't work with out messy combination of javascript libraries, alas. (Dojo 0.4-ish for legacy bits, GWT for new bits) - apparently it will work with either of these frameworks, but for us, with both, it died mysteriously (and we ga

Re: [rspec-users] Before and After blocks for individual feature files?

2009-05-01 Thread Joseph Wilk
Ben Lovell wrote: On Fri, May 1, 2009 at 12:33 PM, Matt Wynne > wrote: Have you looked at celerity? I'm not sure if webrat has an adapter for it yet, but it's a 'headless' browser which drives a lot faster than selenium. Some people on this list are gettin

Re: [rspec-users] Before and After blocks for individual feature files?

2009-05-01 Thread Korny Sietsma
Celerity is very cool - when it works. It didn't work with out messy combination of javascript libraries, alas. (Dojo 0.4-ish for legacy bits, GWT for new bits) - apparently it will work with either of these frameworks, but for us, with both, it died mysteriously (and we gave up trying to fix it

Re: [rspec-users] Before and After blocks for individual feature files?

2009-05-01 Thread Ben Lovell
On Fri, May 1, 2009 at 12:33 PM, Matt Wynne wrote: > > Have you looked at celerity? I'm not sure if webrat has an adapter for it > yet, but it's a 'headless' browser which drives a lot faster than selenium. > Some people on this list are getting a lot of joy out of it. +1 to celerity. You need

Re: [rspec-users] Before and After blocks for individual feature files?

2009-05-01 Thread Matt Wynne
On 1 May 2009, at 03:32, Julian Leviston wrote: Hey ben, Selenium is slow, and we have a lot of Ajax, so I'm just looking at ways to speed it up. Tags will be my first port of call and splitting out between automated and simulated. It irks me we can't then simply run all our tests with o

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-30 Thread Julian Leviston
Hey ben, Selenium is slow, and we have a lot of Ajax, so I'm just looking at ways to speed it up. Tags will be my first port of call and splitting out between automated and simulated. It irks me we can't then simply run all our tests with one simple cucumber command -we need two. It'd be ni

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-29 Thread Mark Wilden
On Wed, Apr 29, 2009 at 8:45 AM, Arco wrote: > Approach A --- > Before: > Given I have a clean database > Scenario Outline: Signup Scenarios > Given I start on the login page > When I signup as > Then I should see > Examples: >| userid | message |

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-29 Thread Andrew Vit
On Apr 29, 2009, at 8:45 AM, Arco wrote: But I am still not convinced that it makes sense for create a new context for each row of an example table. As a newbie, I expected the Before: block would be run once before the scenario, not once before every row of the example table. (so did Ben init

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-29 Thread Arco
After some consideration, I agree with Aslak's and Ben's advice against keeping context across an entire feature. But I am still not convinced that it makes sense for create a new context for each row of an example table. As a newbie, I expected the Before: block would be run once before the scen

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread aslak hellesoy
> Hey Ben, > > It'd be kinda cool if there was a sort of before and after for a feature > rather than each scenario. Is there? > I think that would be particularly *un*cool actually, because people would start using it without understanding the implications. Implications: Coupled, brittle scenario

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Ben Mabey
Julian Leviston wrote: Hey Ben, It'd be kinda cool if there was a sort of before and after for a feature rather than each scenario. Is there? Nope. There is no before(:all) equivalent in cucumber. Just the Before and After hooks, which are for scenarios.. and Backgrounds which are just fo

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Ben Mabey
Arco wrote: Thanks for your reply Ben. +1 on your wording recommendation - I understand and agree 100% However - for me - the Background block executes before each example in the table. Therefore, the database is cleared twice, and the second example ('duplicate userid') fails. (Cucumber 0.3.

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Julian Leviston
Hey Ben, It'd be kinda cool if there was a sort of before and after for a feature rather than each scenario. Is there? (Rails context) We often need this. It'd be really helpful for things like when we want to test about 15 things on a particular web page, and they don't require fresh dat

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Kero van Gelder
> I'd like to do this: > > Feature: user signup > Before: > Given I have a cleaned up database > Scenario Outline: Sign Up > Given I am on the signup page > When I sign up using > Then I should see >Examples: > |userid |message | > |userX |suc

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Arco
Thanks for your reply Ben. +1 on your wording recommendation - I understand and agree 100% However - for me - the Background block executes before each example in the table. Therefore, the database is cleared twice, and the second example ('duplicate userid') fails. (Cucumber 0.3.1 / ruby 1.8.7

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Ben Mabey
Arco wrote: I'd like to do this: Feature: user signup Before: Given I have a cleaned up database Scenario Outline: Sign Up Given I am on the signup page When I sign up using Then I should see Examples: |userid |message | |userX |successful si

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Arco
I'd like to do this: Feature: user signup Before: Given I have a cleaned up database Scenario Outline: Sign Up Given I am on the signup page When I sign up using Then I should see Examples: |userid |message | |userX |successful signup | |us

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread aslak hellesoy
On Tue, Apr 28, 2009 at 6:15 PM, Arco wrote: > OK - I found a workaround. I simply tag the first scenario with > '@first', then > do Before('@first') and i get what I want - executing a block once for > the feature file. > > Except for one problem: most of my scenarios are done as scenario > ou

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Arco
OK - I found a workaround. I simply tag the first scenario with '@first', then do Before('@first') and i get what I want - executing a block once for the feature file. Except for one problem: most of my scenarios are done as scenario outlines, which are run multiple times - once for each row of

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread aslak hellesoy
On Tue, Apr 28, 2009 at 5:32 PM, Arco wrote: > I also would like a hook that executes a block once before running a > feature file. > > In my testing i found that: > - Background: executes before each scenario > - Before executes before each scenario > - Before('@tag') executes before each scenar

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Arco
I also would like a hook that executes a block once before running a feature file. In my testing i found that: - Background: executes before each scenario - Before executes before each scenario - Before('@tag') executes before each scenario Is there a way to execute a block once before each featu

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread aslak hellesoy
> Hi -- is it possible to set before and after blocks for individual feature > files? Yes. Use tagged hooks: http://wiki.github.com/aslakhellesoy/cucumber/hooks Aslak > > I've tried putting them in step files, but they just get called before > everything, like they'd been declared in env.rb, w

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread doug livesey
Brilliant, cheers! Doug. 2009/4/28 Julian Leviston > Perhaps use background? > > Julian. > > > > On 28/04/2009, at 10:18 PM, doug livesey wrote: > > Hi -- is it possible to set before and after blocks for individual feature >> files? >> I've tried putting them in step files, but they just ge

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Julian Leviston
Perhaps use background? Julian. On 28/04/2009, at 10:18 PM, doug livesey wrote: Hi -- is it possible to set before and after blocks for individual feature files? I've tried putting them in step files, but they just get called before everything, like they'd been declared in env.rb, which is

[rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread doug livesey
Hi -- is it possible to set before and after blocks for individual feature files? I've tried putting them in step files, but they just get called before everything, like they'd been declared in env.rb, which is consistent with how I thought cucumber worked, but I thought I'd best try it anyway. Any