Class: Spec::Story::GivenScenario

Inherits:
Object
  • Object
show all
Defined in:
lib/spec/rails/story_adapter.rb,
lib/spec/story/given_scenario.rb

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ GivenScenario

Returns a new instance of GivenScenario.



4
5
6
# File 'lib/spec/story/given_scenario.rb', line 4

def initialize(name)
  @name = name
end

Instance Method Details

#perform(instance, ignore_name) ⇒ Object



73
74
75
76
77
78
# File 'lib/spec/rails/story_adapter.rb', line 73

def perform(instance, name = nil)
  scenario = Spec::Story::Runner::StoryRunner.scenario_from_current_story @name
  runner = Spec::Story::Runner::ScenarioRunner.new
  runner.instance_variable_set(:@listeners,[])
  runner.run(scenario, instance)
end