Class: TestSuite

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) ⇒ TestSuite



7
8
9
10
11
# File 'lib/ui-auto-monkey/tuneup/test_runner/xunit_output.rb', line 7

def initialize(name)
  @name = name
  @test_cases = []
  @timestamp = DateTime.now
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/ui-auto-monkey/tuneup/test_runner/xunit_output.rb', line 4

def name
  @name
end

#test_casesObject

Returns the value of attribute test_cases.



5
6
7
# File 'lib/ui-auto-monkey/tuneup/test_runner/xunit_output.rb', line 5

def test_cases
  @test_cases
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



4
5
6
# File 'lib/ui-auto-monkey/tuneup/test_runner/xunit_output.rb', line 4

def timestamp
  @timestamp
end

Instance Method Details

#failuresObject



13
14
15
# File 'lib/ui-auto-monkey/tuneup/test_runner/xunit_output.rb', line 13

def failures
  @test_cases.count { |test| test.failed? }
end

#timeObject



17
18
19
# File 'lib/ui-auto-monkey/tuneup/test_runner/xunit_output.rb', line 17

def time
  @test_cases.map { |test| test.time }.inject(:+)
end