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

### Methods

create_given create_given_scenario create_scenario create_story create_then create_when new run_stories stories

### Classes and Modules

Class Spec::Story::Runner::StoryMediator::Scenario
Class Spec::Story::Runner::StoryMediator::Step
Class Spec::Story::Runner::StoryMediator::Story

### Public Class methods

new(step_group, runner, options={})

[Source]

        # File lib/spec/story/runner/story_mediator.rb, line 6
     6:         def initialize(step_group, runner, options={})
     7:           @step_group = step_group
     8:           @stories = []
     9:           @runner = runner
    10:           @options = options
    11:         end

### Public Instance methods

create_given(name)

[Source]

        # File lib/spec/story/runner/story_mediator.rb, line 25
    25:         def create_given(name)
    26:           current_scenario.add_step Step.new('Given', name)
    27:         end

create_given_scenario(name)

[Source]

        # File lib/spec/story/runner/story_mediator.rb, line 29
    29:         def create_given_scenario(name)
    30:           current_scenario.add_step Step.new('GivenScenario', name)
    31:         end

create_scenario(title)

[Source]

        # File lib/spec/story/runner/story_mediator.rb, line 21
    21:         def create_scenario(title)
    22:           current_story.add_scenario Scenario.new(title)
    23:         end

create_story(title, narrative)

[Source]

        # File lib/spec/story/runner/story_mediator.rb, line 17
    17:         def create_story(title, narrative)
    18:           @stories << Story.new(title, narrative, @step_group, @options)
    19:         end

create_then(name)

[Source]

        # File lib/spec/story/runner/story_mediator.rb, line 37
    37:         def create_then(name)
    38:           current_scenario.add_step Step.new('Then', name)
    39:         end

create_when(name)

[Source]

        # File lib/spec/story/runner/story_mediator.rb, line 33
    33:         def create_when(name)
    34:           current_scenario.add_step Step.new('When', name)
    35:         end

run_stories()

[Source]

        # File lib/spec/story/runner/story_mediator.rb, line 41
    41:         def run_stories
    42:           stories.each { |story| @runner.instance_eval(&story) }
    43:         end

stories()

[Source]

        # File lib/spec/story/runner/story_mediator.rb, line 13
    13:         def stories
    14:           @stories.collect { |p| p.to_proc }
    15:         end

[Validate]