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.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/sapphire/Testing/ResultTree.rb', line 8

def initialize(text, result)

  @type = 'pass'
  @execution_time = 0

  if(result != nil)
    self.type = result.type
    @iconCls = "accept" if result.type == "pass"
    @iconCls = "delete" if result.type == "fail"
    @iconCls = "error" if result.type == "pending"
    @execution_time = result.execution_time
    @expanded = true
    @message = result.message
    @stack = result.stack
  end
  @text = text
  @results = []
  @leaf = true

end

Instance Attribute Details

#resultsObject

Returns the value of attribute results.



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

def results
  @results
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



29
30
31
32
# File 'lib/sapphire/Testing/ResultTree.rb', line 29

def AddChild(node)
  @results << node
  @leaf = false
end