Class: Spex::Scenario

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/spex/scenario.rb

Defined Under Namespace

Classes: Builder

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &block) ⇒ Scenario

Returns a new instance of Scenario.



6
7
8
9
# File 'lib/spex/scenario.rb', line 6

def initialize(name, &block)
  @name = name
  Builder.new(self, &block)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/spex/scenario.rb', line 5

def name
  @name
end

Instance Method Details

#<<(execution) ⇒ Object



15
16
17
# File 'lib/spex/scenario.rb', line 15

def <<(execution)
  executions << execution
end

#each(&block) ⇒ Object



19
20
21
# File 'lib/spex/scenario.rb', line 19

def each(&block)
  executions.each(&block)
end

#executionsObject



11
12
13
# File 'lib/spex/scenario.rb', line 11

def executions
  @executions ||= []
end