Class: Test::Unit::UI::Statistics::CaseStatistics

Inherits:
Object
  • Object
show all
Defined in:
lib/test/unit/ui/statistics.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(results) ⇒ CaseStatistics

Returns a new instance of CaseStatistics.



10
11
12
13
14
15
16
17
18
19
# File 'lib/test/unit/ui/statistics.rb', line 10

def initialize results
  self.pass = 0
  self.fail = 0
  self.errs = 0
  self.pend = 0
  self.omit = 0
  self.note = 0
  @start_time = Time.now
  @end_time = nil
end

Instance Attribute Details

#errsObject

Returns the value of attribute errs.



5
6
7
# File 'lib/test/unit/ui/statistics.rb', line 5

def errs
  @errs
end

#failObject

Returns the value of attribute fail.



4
5
6
# File 'lib/test/unit/ui/statistics.rb', line 4

def fail
  @fail
end

#noteObject

Returns the value of attribute note.



8
9
10
# File 'lib/test/unit/ui/statistics.rb', line 8

def note
  @note
end

#omitObject

Returns the value of attribute omit.



7
8
9
# File 'lib/test/unit/ui/statistics.rb', line 7

def omit
  @omit
end

#passObject

Returns the value of attribute pass.



3
4
5
# File 'lib/test/unit/ui/statistics.rb', line 3

def pass
  @pass
end

#pendObject

Returns the value of attribute pend.



6
7
8
# File 'lib/test/unit/ui/statistics.rb', line 6

def pend
  @pend
end

Instance Method Details

#completeObject



29
30
31
# File 'lib/test/unit/ui/statistics.rb', line 29

def complete
  @end_time = Time.now
end

#elapsed_timeObject



21
22
23
# File 'lib/test/unit/ui/statistics.rb', line 21

def elapsed_time
  end_time - @start_time
end

#end_timeObject



25
26
27
# File 'lib/test/unit/ui/statistics.rb', line 25

def end_time
  @end_time ? @end_time : Time.now
end