Class: Background
- Inherits:
-
Object
- Object
- Background
- Includes:
- Sapphire::Testing::Executable
- Defined in:
- lib/sapphire/DSL/Scenarios/background.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #AddResult(result) ⇒ Object
-
#initialize(parent, pre, text, &block) ⇒ Background
constructor
A new instance of Background.
Methods included from Sapphire::Testing::Executable
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
#block ⇒ Object (readonly)
Returns the value of attribute block.
6 7 8 |
# File 'lib/sapphire/DSL/Scenarios/background.rb', line 6 def block @block end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
7 8 9 |
# File 'lib/sapphire/DSL/Scenarios/background.rb', line 7 def parent @parent end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
8 9 10 |
# File 'lib/sapphire/DSL/Scenarios/background.rb', line 8 def results @results end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
5 6 7 |
# File 'lib/sapphire/DSL/Scenarios/background.rb', line 5 def text @text end |
#value ⇒ Object (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 |