Sha256: 8f87ad28c1eef8fb99151e1d01c3e805720fc382734c62481160544d366f3da5

Contents?: true

Size: 836 Bytes

Versions: 73

Compression:

Stored size: 836 Bytes

Contents

module Spec
  module Story
    class StoryBuilder
      def initialize
        @title = 'a story'
        @narrative = 'narrative'
      end
      
      def title(value)
        @title = value
        self
      end
      
      def narrative(value)
        @narrative = value
        self
      end
      
      def to_story(&block)
        block = lambda {} unless block_given?
        Story.new @title, @narrative, &block
      end
    end
    
    class ScenarioBuilder
      def initialize
        @name = 'a scenario'
        @story = StoryBuilder.new.to_story
      end
      
      def name(value)
        @name = value
        self
      end
      
      def story(value)
        @story = value
        self
      end
      
      def to_scenario(&block)
        Scenario.new @story, @name, &block
      end
    end
  end
end

Version data entries

73 entries across 73 versions & 13 rubygems

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