Class: Spec::Story::Runner::StoryMediator::Scenario
- Inherits:
-
Object
- Object
- Spec::Story::Runner::StoryMediator::Scenario
- Defined in:
- lib/spec/story/runner/story_mediator.rb
Instance Method Summary collapse
- #add_step(step) ⇒ Object
-
#initialize(name) ⇒ Scenario
constructor
A new instance of Scenario.
- #last_step ⇒ Object
- #to_proc ⇒ Object
Constructor Details
#initialize(name) ⇒ Scenario
Returns a new instance of Scenario.
93 94 95 96 |
# File 'lib/spec/story/runner/story_mediator.rb', line 93 def initialize(name) @name = name @steps = [] end |
Instance Method Details
#add_step(step) ⇒ Object
108 109 110 |
# File 'lib/spec/story/runner/story_mediator.rb', line 108 def add_step(step) @steps << step end |
#last_step ⇒ Object
112 113 114 |
# File 'lib/spec/story/runner/story_mediator.rb', line 112 def last_step @steps.last end |
#to_proc ⇒ Object
98 99 100 101 102 103 104 105 106 |
# File 'lib/spec/story/runner/story_mediator.rb', line 98 def to_proc name = @name steps = @steps.collect { |step| step.to_proc } lambda do Scenario name do steps.each { |step| instance_eval(&step) } end end end |