Class: Spec::Story::Runner::StoryMediator::Story

Class | Spec::Story::Runner::StoryMediator::Story
In: | lib/spec/story/runner/story_mediator.rb
Parent: | Object

### Methods

add_scenario current_scenario new to_proc

### Public Class methods

new(title, narrative, step_group, options)

[Source]

        # File lib/spec/story/runner/story_mediator.rb, line 55
    55:           def initialize(title, narrative, step_group, options)
    56:             @title = title
    57:             @narrative = narrative
    58:             @scenarios = []
    59:             @step_group = step_group
    60:             @options = options
    61:           end

### Public Instance methods

add_scenario(scenario)

[Source]

        # File lib/spec/story/runner/story_mediator.rb, line 75
    75:           def add_scenario(scenario)
    76:             @scenarios << scenario
    77:           end

current_scenario()

[Source]

        # File lib/spec/story/runner/story_mediator.rb, line 79
    79:           def current_scenario
    80:             @scenarios.last
    81:           end

to_proc()

[Source]

        # File lib/spec/story/runner/story_mediator.rb, line 63
    63:           def to_proc
    64:             title = @title
    65:             narrative = @narrative
    66:             scenarios = @scenarios.collect { |scenario| scenario.to_proc }
    67:             options = @options.merge(:steps => @step_group)
    68:             lambda do
    69:               Story title, narrative, options do
    70:                 scenarios.each { |scenario| instance_eval(&scenario) }
    71:               end
    72:             end
    73:           end

[Validate]