method
run

RSpec latest stable (1.3.1)
-
0 notes -
Class: Spec::Story::Runner::ScenarioRunner
- 1.1.4 (0)
- 1.1.12 (0)
- 1.2.0
- 1.2.8
- 1.3.0
- 1.3.1
- What's this?
run(scenario, world)
public
Hide source
# File lib/spec/story/runner/scenario_runner.rb, line 9 def run(scenario, world) @listeners.each { |l| l.scenario_started(scenario.story.title, scenario.name) } run_story_ignoring_scenarios(scenario.story, world) world.start_collecting_errors unless scenario.body @listeners.each { |l| l.scenario_pending(scenario.story.title, scenario.name, '') } return true end world.instance_eval(&scenario.body) if world.errors.empty? @listeners.each { |l| l.scenario_succeeded(scenario.story.title, scenario.name) } else if Spec::Example::ExamplePendingError === (e = world.errors.first) @listeners.each { |l| l.scenario_pending(scenario.story.title, scenario.name, e.message) } else @listeners.each { |l| l.scenario_failed(scenario.story.title, scenario.name, e) } return false end end true end