[rspec-users] Cucumber: GivenScenario doesn't seem to work
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
> 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:
> `given_scenario_steps': You have a nil object when you didn't expect it!
> The error occurred while evaluating nil.steps from
> ... 6 levels...
> rake aborted!
> Command failed with status (1): [/usr/local/bin/ruby -I
> 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.
> 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
More information about the rspec-users