Class: Spec::Story::ScenarioBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/gems/rspec-1.1.11/spec/spec/story/builders.rb

Instance Method Summary collapse

Constructor Details

#initializeScenarioBuilder

Returns a new instance of ScenarioBuilder.



26
27
28
29
# File 'lib/gems/rspec-1.1.11/spec/spec/story/builders.rb', line 26

def initialize
  @name = 'a scenario'
  @story = StoryBuilder.new.to_story
end

Instance Method Details

#name(value) ⇒ Object



31
32
33
34
# File 'lib/gems/rspec-1.1.11/spec/spec/story/builders.rb', line 31

def name(value)
  @name = value
  self
end

#story(value) ⇒ Object



36
37
38
39
# File 'lib/gems/rspec-1.1.11/spec/spec/story/builders.rb', line 36

def story(value)
  @story = value
  self
end

#to_scenario(&block) ⇒ Object



41
42
43
# File 'lib/gems/rspec-1.1.11/spec/spec/story/builders.rb', line 41

def to_scenario(&block)
  Scenario.new @story, @name, &block
end