Sha256: fa29d1f9af87255fe857924f8b9c7bee6217be894da9e7ed8ea2d9cfa76c4dd2
Contents?: true
Size: 823 Bytes
Versions: 53
Compression:
Stored size: 823 Bytes
Contents
module Spec module Story class Story attr_reader :title, :narrative def initialize(title, narrative, params = {}, &body) @body = body @title = title @narrative = narrative @params = params end def [](key) @params[key] end def run_in(obj) obj.instance_eval(&@body) end def assign_steps_to(assignee) if steps=@params[:steps_for] steps = [steps] unless steps.is_a?(Array) steps.each do |step| if step.is_a?(StepGroup) assignee.use(step) else assignee.use(steps_for(step)) end end end end def steps_for(key) $rspec_story_steps[key] end end end end
Version data entries
53 entries across 53 versions & 11 rubygems