Methods
Attributes
| [R] | narrative | |
| [R] | title |
Public Class methods
[ show 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
[ show source ]
# File lib/spec/story/story.rb, line 13
13: def [](key)
14: @params[key]
15: end
[ show source ]
# File lib/spec/story/story.rb, line 21
21: def assign_steps_to(assignee)
22: if @params[:steps]
23: assignee.use(@params[:steps])
24: else
25: case keys = @params[:steps_for]
26: when Symbol
27: keys = [keys]
28: when nil
29: keys = []
30: end
31: keys.each do |key|
32: assignee.use(steps_for(key))
33: end
34: end
35: end
[ show source ]
# File lib/spec/story/story.rb, line 17
17: def run_in(obj)
18: obj.instance_eval(&@body)
19: end
[ show source ]
# File lib/spec/story/story.rb, line 37
37: def steps_for(key)
38: $rspec_story_steps[key]
39: end