Class: Test::Unit::TestResult

Inherits:
Object
  • Object
show all
Defined in:
lib/shell_test/unit/shim.rb

Instance Method Summary collapse

Instance Method Details

#add_error(error) ⇒ Object

Partition errors from a SkipException from other errors and records as them as skips (the error is extended to display as a skip).



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/shell_test/unit/shim.rb', line 41

def add_error(error)
  if error.exception.kind_of?(ShellTest::Unit::SkipException)
    error.extend ShellTest::Unit::SkipDisplay
    skips << error
  else
    @errors << error
  end

  notify_listeners(FAULT, error)
  notify_listeners(CHANGED, self)
end

#shell_test_original_add_errorObject



37
# File 'lib/shell_test/unit/shim.rb', line 37

alias shell_test_original_add_error add_error

#shell_test_original_to_sObject



53
# File 'lib/shell_test/unit/shim.rb', line 53

alias shell_test_original_to_s to_s

#skipsObject

Returns an array of skips recorded for self.



33
34
35
# File 'lib/shell_test/unit/shim.rb', line 33

def skips
  @skips ||= []
end

#to_sObject

Adds the skip count to the summary.



56
57
58
# File 'lib/shell_test/unit/shim.rb', line 56

def to_s
  "#{shell_test_original_to_s}, #{skips.length} skips"
end