Class: Background

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Sapphire::Testing::Executable

#execute

Constructor Details

#initialize(parent, pre, text, &block) ⇒ Background

Returns a new instance of Background.



10
11
12
13
14
15
16
# File 'lib/sapphire/DSL/Scenarios/background.rb', line 10

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

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



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

def block
  @block
end

#parentObject (readonly)

Returns the value of attribute parent.



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

def parent
  @parent
end

#resultsObject (readonly)

Returns the value of attribute results.



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

def results
  @results
end

#textObject (readonly)

Returns the value of attribute text.



5
6
7
# File 'lib/sapphire/DSL/Scenarios/background.rb', line 5

def text
  @text
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/sapphire/DSL/Scenarios/background.rb', line 4

def value
  @value
end

Instance Method Details

#AddResult(result) ⇒ Object



18
19
20
21
# File 'lib/sapphire/DSL/Scenarios/background.rb', line 18

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