Class: Sapphire::Testing::ResultTree
- Defined in:
- lib/sapphire/Testing/ResultTree.rb
Instance Attribute Summary collapse
-
#item ⇒ Object
Returns the value of attribute item.
-
#messages ⇒ Object
Returns the value of attribute messages.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#results ⇒ Object
Returns the value of attribute results.
-
#stack ⇒ Object
Returns the value of attribute stack.
-
#text ⇒ Object
Returns the value of attribute text.
-
#time ⇒ Object
Returns the value of attribute time.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #AddChild(node) ⇒ Object
-
#initialize(text, result) ⇒ ResultTree
constructor
A new instance of ResultTree.
Constructor Details
#initialize(text, result) ⇒ ResultTree
Returns a new instance of ResultTree.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/sapphire/Testing/ResultTree.rb', line 14 def initialize(text, result) @type = 'pass' @time = 0 if(result != nil) self.type = result.type @time = result.execution_time @expanded = true @messages = result. @stack = result.stack end @text = text @results = [] @leaf = true end |
Instance Attribute Details
#item ⇒ Object
Returns the value of attribute item.
12 13 14 |
# File 'lib/sapphire/Testing/ResultTree.rb', line 12 def item @item end |
#messages ⇒ Object
Returns the value of attribute messages.
8 9 10 |
# File 'lib/sapphire/Testing/ResultTree.rb', line 8 def @messages end |
#parent ⇒ Object
Returns the value of attribute parent.
11 12 13 |
# File 'lib/sapphire/Testing/ResultTree.rb', line 11 def parent @parent end |
#results ⇒ Object
Returns the value of attribute results.
5 6 7 |
# File 'lib/sapphire/Testing/ResultTree.rb', line 5 def results @results end |
#stack ⇒ Object
Returns the value of attribute stack.
9 10 11 |
# File 'lib/sapphire/Testing/ResultTree.rb', line 9 def stack @stack end |
#text ⇒ Object
Returns the value of attribute text.
7 8 9 |
# File 'lib/sapphire/Testing/ResultTree.rb', line 7 def text @text end |
#time ⇒ Object
Returns the value of attribute time.
10 11 12 |
# File 'lib/sapphire/Testing/ResultTree.rb', line 10 def time @time end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/sapphire/Testing/ResultTree.rb', line 6 def type @type end |
Instance Method Details
#AddChild(node) ⇒ Object
32 33 34 35 36 |
# File 'lib/sapphire/Testing/ResultTree.rb', line 32 def AddChild(node) node.parent = self @results << node @leaf = false end |