[rspec-users] Cucumber: GivenScenario doesn't seem to work
aslak hellesoy
aslak.hellesoy at gmail.com
Mon Sep 1 16:34:11 EDT 2008
On Mon, Sep 1, 2008 at 7:12 PM, Matt Wynne <matt at mattwynne.net> wrote:
> 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:in
> `steps'
> 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:in
> `map'
> 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:in
> `accept'
> 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:in
> `visit_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:in
> `visit_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:in
> `execute'
> 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?
>
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
> 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.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
More information about the rspec-users
mailing list