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

Version Path
dchelimsky-rspec-1.1.10 lib/spec/story/story.rb
dchelimsky-rspec-1.1.11.1 lib/spec/story/story.rb
dchelimsky-rspec-1.1.11.2 lib/spec/story/story.rb
dchelimsky-rspec-1.1.11.3 lib/spec/story/story.rb
dchelimsky-rspec-1.1.11.4 lib/spec/story/story.rb
dchelimsky-rspec-1.1.11.5 lib/spec/story/story.rb
dchelimsky-rspec-1.1.11.6 lib/spec/story/story.rb
dchelimsky-rspec-1.1.11.7 lib/spec/story/story.rb
dchelimsky-rspec-1.1.11 lib/spec/story/story.rb
dchelimsky-rspec-stories-1.0.0 lib/spec/story/story.rb
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec/lib/spec/story/story.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec/lib/spec/story/story.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec/lib/spec/story/story.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec/lib/spec/story/story.rb
samstokes-rspec-stories-1.0.1 lib/spec/story/story.rb
samstokes-rspec-stories-1.0.2 lib/spec/story/story.rb
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/lib/spec/story/story.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/lib/spec/story/story.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/lib/spec/story/story.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/lib/spec/story/story.rb