Class | Spec::Story::Story
In: | lib/spec/story/story.rb
Parent: | Object

### Methods

[] assign_steps_to new run_in steps_for

### Attributes

narrative | [R] |
title | [R] |

### Public Class methods

new(title, narrative, params = {}, &body)

[Source]

        # File lib/spec/story/story.rb, line 6
     6:       def initialize(title, narrative, params = {}, &body)
     7:         @body = body
     8:         @title = title
     9:         @narrative = narrative
    10:         @params = params
    11:       end

### Public Instance methods

[](key)

[Source]

        # File lib/spec/story/story.rb, line 13
    13:       def [](key)
    14:         @params[key]
    15:       end

assign_steps_to(assignee)

[Source]

        # File lib/spec/story/story.rb, line 21
    21:       def assign_steps_to(assignee)
    22:         if steps=@params[:steps_for]
    23:           steps = [steps] unless steps.is_a?(Array)
    24:           steps.each do |step|
    25:             if step.is_a?(StepGroup)
    26:               assignee.use(step)
    27:             else
    28:               assignee.use(steps_for(step))
    29:             end
    30:           end
    31:         end
    32:       end

run_in(obj)

[Source]

        # File lib/spec/story/story.rb, line 17
    17:       def run_in(obj)
    18:         obj.instance_eval(&@body)
    19:       end

steps_for(key)

[Source]

        # File lib/spec/story/story.rb, line 34
    34:       def steps_for(key)
    35:         $rspec_story_steps[key]
    36:       end

[Validate]