Class: And

Inherits:
Object show all
Includes:
Sapphire::Testing::Executable
Defined in:
lib/sapphire/DSL/Scenarios/and.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Sapphire::Testing::Executable

#Report, #execute, #pend

Constructor Details

#initialize(parent, text, &block) ⇒ And

Returns a new instance of And.



12
13
14
15
16
17
18
# File 'lib/sapphire/DSL/Scenarios/and.rb', line 12

def initialize(parent, text, &block)
  @block = block
  @text = text.to_s
  @value = text
  @parent = parent
  @results = []
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



7
8
9
# File 'lib/sapphire/DSL/Scenarios/and.rb', line 7

def block
  @block
end

#parentObject (readonly)

Returns the value of attribute parent.



9
10
11
# File 'lib/sapphire/DSL/Scenarios/and.rb', line 9

def parent
  @parent
end

#resultsObject (readonly)

Returns the value of attribute results.



10
11
12
# File 'lib/sapphire/DSL/Scenarios/and.rb', line 10

def results
  @results
end

#textObject (readonly)

Returns the value of attribute text.



6
7
8
# File 'lib/sapphire/DSL/Scenarios/and.rb', line 6

def text
  @text
end

#valueObject (readonly)

Returns the value of attribute value.



8
9
10
# File 'lib/sapphire/DSL/Scenarios/and.rb', line 8

def value
  @value
end

Instance Method Details

#AddResult(result) ⇒ Object



20
21
22
23
24
# File 'lib/sapphire/DSL/Scenarios/and.rb', line 20

def AddResult(result)
  result.item = self
  @results << result
  self.parent.results.last.AddChild(result)
end