Class: TestCase

Inherits:
Object
  • Object
show all
Defined in:
lib/ui-auto-monkey/tuneup/test_runner/xunit_output.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ TestCase

Returns a new instance of TestCase.



26
27
28
29
30
31
32
# File 'lib/ui-auto-monkey/tuneup/test_runner/xunit_output.rb', line 26

def initialize(name)
  @name = name
  @messages = []
  @failed = true
  @start = Time.now
  @finish = nil
end

Instance Attribute Details

#messagesObject

Returns the value of attribute messages.



24
25
26
# File 'lib/ui-auto-monkey/tuneup/test_runner/xunit_output.rb', line 24

def messages
  @messages
end

#nameObject (readonly)

Returns the value of attribute name.



23
24
25
# File 'lib/ui-auto-monkey/tuneup/test_runner/xunit_output.rb', line 23

def name
  @name
end

Instance Method Details

#<<(message) ⇒ Object



34
35
36
# File 'lib/ui-auto-monkey/tuneup/test_runner/xunit_output.rb', line 34

def <<(message)
  @messages << message
end

#fail!Object



43
44
45
# File 'lib/ui-auto-monkey/tuneup/test_runner/xunit_output.rb', line 43

def fail!
  @finish = Time.now
end

#failed?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/ui-auto-monkey/tuneup/test_runner/xunit_output.rb', line 47

def failed?
  @failed
end

#pass!Object



38
39
40
41
# File 'lib/ui-auto-monkey/tuneup/test_runner/xunit_output.rb', line 38

def pass!
  @failed = false;
  @finish = Time.now
end

#timeObject



51
52
53
54
# File 'lib/ui-auto-monkey/tuneup/test_runner/xunit_output.rb', line 51

def time
  return 0 if @finish.nil?
  @finish - @start
end