Class: Sapphire::Testing::ResultTree

Inherits:
Object
  • Object
show all
Defined in:
lib/sapphire/Testing/ResultTree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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.messages
    @stack = result.stack
  end
  @text = text
  @results = []
  @leaf = true

end

Instance Attribute Details

#itemObject

Returns the value of attribute item.



12
13
14
# File 'lib/sapphire/Testing/ResultTree.rb', line 12

def item
  @item
end

#messagesObject

Returns the value of attribute messages.



8
9
10
# File 'lib/sapphire/Testing/ResultTree.rb', line 8

def messages
  @messages
end

#parentObject

Returns the value of attribute parent.



11
12
13
# File 'lib/sapphire/Testing/ResultTree.rb', line 11

def parent
  @parent
end

#resultsObject

Returns the value of attribute results.



5
6
7
# File 'lib/sapphire/Testing/ResultTree.rb', line 5

def results
  @results
end

#stackObject

Returns the value of attribute stack.



9
10
11
# File 'lib/sapphire/Testing/ResultTree.rb', line 9

def stack
  @stack
end

#textObject

Returns the value of attribute text.



7
8
9
# File 'lib/sapphire/Testing/ResultTree.rb', line 7

def text
  @text
end

#timeObject

Returns the value of attribute time.



10
11
12
# File 'lib/sapphire/Testing/ResultTree.rb', line 10

def time
  @time
end

#typeObject

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