Cucumber: GivenScenario doesn't seem to work

I’m hardly a story-runner expert, so I may be making a dumb mistake
here… I’m trying to get one scenario to run another as part of its
Given clause. It looks like this:

Scenario: Admin user merges two venues
GivenScenario Admin user views two venues
When I go to “/admin/venues”
Then I should see “Venue1”

Obviously the When / Then bits will get more complicated once I get
this working.

In another .feature file, I have the following scenario (which passes)

Scenario: Admin user views two venues
Given the default city exists

The scenario “Admin user merges two venues” fails with this ugly
backtrace:

/Users/matt/Documents/projects/songkick/skweb/vendor/plugins/cucumber/
lib/cucumber/tree/scenario.rb:45:in given_scenario_steps': You have a nil object when you didn't expect it! (NoMethodError) The error occurred while evaluating nil.steps from /Users/matt/ Documents/projects/songkick/skweb/vendor/plugins/cucumber/lib/ cucumber/tree/given_scenario.rb:9:insteps’
from /Users/matt/Documents/projects/songkick/skweb/vendor/
plugins/cucumber/lib/cucumber/tree/scenario.rb:41:in steps' from /Users/matt/Documents/projects/songkick/skweb/vendor/ plugins/cucumber/lib/cucumber/tree/scenario.rb:41:inmap’
from /Users/matt/Documents/projects/songkick/skweb/vendor/
plugins/cucumber/lib/cucumber/tree/scenario.rb:41:in steps' from /Users/matt/Documents/projects/songkick/skweb/vendor/ plugins/cucumber/lib/cucumber/tree/scenario.rb:9:inaccept’
from /Users/matt/Documents/projects/songkick/skweb/vendor/
plugins/cucumber/lib/cucumber/executor.rb:62:in visit_scenario' from /Users/matt/Documents/projects/songkick/skweb/vendor/ plugins/cucumber/lib/cucumber/executor.rb:53:invisit_regular_scenario’
from /Users/matt/Documents/projects/songkick/skweb/vendor/
plugins/cucumber/lib/cucumber/tree/feature.rb:47:in accept' ... 6 levels... from /Users/matt/Documents/projects/songkick/skweb/vendor/ plugins/cucumber/lib/cucumber/executor.rb:36:invisit_features’
from /Users/matt/Documents/projects/songkick/skweb/vendor/
plugins/cucumber/lib/cucumber/cli.rb:84:in execute!' from /Users/matt/Documents/projects/songkick/skweb/vendor/ plugins/cucumber/lib/cucumber/cli.rb:11:inexecute’
from /Users/matt/Documents/projects/songkick/skweb/vendor/
plugins/cucumber/bin/cucumber:3
rake aborted!
Command failed with status (1): [/usr/local/bin/ruby -I "/Users/matt/
Docume…]

What am I doing wrong?

cheers,
Matt

http://blog.mattwynne.net
http://songkick.com

In case you wondered: The opinions expressed in this email are my own
and do not necessarily reflect the views of any former, current or
future employers of mine.

On Mon, Sep 1, 2008 at 7:12 PM, Matt W. [email protected] wrote:

Scenario: Admin user views two venues
from
`accept’
from
rake aborted!
Command failed with status (1): [/usr/local/bin/ruby -I
"/Users/matt/Docume…]

What am I doing wrong?

GivenScenario only works when you’re pointing to a scenario in the
same feature/same feature file.

Please add a feature request if you want it to work differently.
http://rspec.lighthouseapp.com/projects/16211-cucumber/overview

Aslak

On 1 Sep 2008, at 21:34, aslak hellesoy wrote:

What am I doing wrong?

GivenScenario only works when you’re pointing to a scenario in the
same feature/same feature file.

Please add a feature request if you want it to work differently.
http://rspec.lighthouseapp.com/projects/16211-cucumber/overview

It is done:
http://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/3-
create-givenscenario-dependency-accross-feature-files

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs