[rspec-devel] [ rspec-Bugs-15659 ] GivenScenario fails when it is a RailsStory

noreply at rubyforge.org noreply at rubyforge.org
Thu Nov 15 17:50:17 EST 2007


Bugs item #15659, was opened at 2007-11-15 16:50
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=15659&group_id=797

Category: rails plugin
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Nathan Sutton (fowlduck)
Assigned to: Nobody (None)
Summary: GivenScenario fails when it is a RailsStory

Initial Comment:
Given the following code:
require File.dirname(__FILE__) + "/helper"

Story "Checkin out the lil buggles", %Q{
  As a user of rspec
  I want to check out the lil buggles
  So that I can run rails stories
}, :type => RailsStory do
  Scenario "We have one scenario" do
    Given "a scenario"
    When "it is run"
    Then "it should be ok"
  end
    
  Scenario "We have a second scenario" do
    GivenScenario "We have one scenario"
    When "it is run again"
    Then "it should bork"
  end
end



And it is run:

$ ruby stories/test.story 
Running 2 scenarios:

Story: Checkin out the lil buggles

  
    As a user of rspec
    I want to check out the lil buggles
    So that I can run rails stories


Scenario: We have one scenario

  Given a scenario (PENDING)

  When it is run (PENDING)

  Then it should be ok (PENDING)

/Users/nate/Code/sevenwire/rediswhite/repository/trunk/vendor/plugins/rspec/lib/spec/story/world.rb:48:in `perform': wrong number of arguments (2 for 1) (ArgumentError)
	from /Users/nate/Code/sevenwire/rediswhite/repository/trunk/vendor/plugins/rspec/lib/spec/story/world.rb:48:in `run_given_scenario_with_suspended_listeners'
	from /Users/nate/Code/sevenwire/rediswhite/repository/trunk/vendor/plugins/rspec/lib/spec/story/world.rb:87:in `GivenScenario'
	from stories/test.story:15
	from /Users/nate/Code/sevenwire/rediswhite/repository/trunk/vendor/plugins/rspec/lib/spec/story/runner/scenario_runner.rb:14:in `instance_eval'
	from /Users/nate/Code/sevenwire/rediswhite/repository/trunk/vendor/plugins/rspec/lib/spec/story/runner/scenario_runner.rb:14:in `run'
	from /Users/nate/Code/sevenwire/rediswhite/repository/trunk/vendor/plugins/rspec/lib/spec/story/runner/story_runner.rb:48:in `run_stories'
	from /Users/nate/Code/sevenwire/rediswhite/repository/trunk/vendor/plugins/rspec/lib/spec/story/runner/story_runner.rb:44:in `each'
	from /Users/nate/Code/sevenwire/rediswhite/repository/trunk/vendor/plugins/rspec/lib/spec/story/runner/story_runner.rb:44:in `run_stories'
	from /Users/nate/Code/sevenwire/rediswhite/repository/trunk/vendor/plugins/rspec/lib/spec/story/runner/story_runner.rb:39:in `each'
	from /Users/nate/Code/sevenwire/rediswhite/repository/trunk/vendor/plugins/rspec/lib/spec/story/runner/story_runner.rb:39:in `run_stories'
	from /Users/nate/Code/sevenwire/rediswhite/repository/trunk/vendor/plugins/rspec/lib/spec/story/runner.rb:49:in `register_exit_hook'
	from stories/test.story:3
Scenario: We have a second scenario





It is an issue with Spec::Story::GivenScenario#perform in rspec_on_rails/lib/spec/rails/story_adapter.rb on line 42.  It expects it to take a second argument like GivenScenario does elsewhere.  

I have attached a patch, I think I did it right.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=15659&group_id=797


More information about the rspec-devel mailing list