123456789_123456789_123456789_123456789_123456789_

Module: Minitest::Reportable

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/minitest.rb

Overview

Shared code for anything that can get passed to a Reporter. See Test & Result.

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#error?Boolean (readonly)

Did this run error?

[ GitHub ]

  
# File 'lib/minitest.rb', line 490

def error?
  self.failures.any? { |f| UnexpectedError === f }
end

#passed?Boolean (readonly)

Did this run pass?

Note: skipped runs are not considered passing, but they don’t cause the process to exit non-zero.

[ GitHub ]

  
# File 'lib/minitest.rb', line 456

def passed?
  not self.failure
end

#skipped?Boolean (readonly)

Was this run skipped?

[ GitHub ]

  
# File 'lib/minitest.rb', line 483

def skipped?
  self.failure and Skip === self.failure
end

Instance Method Details

#class_name

This method is for internal use only.

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'lib/minitest.rb', line 469

def class_name # :nodoc:
  raise NotImplementedError, "subclass responsibility"
end

#location

The location identifier of this test. Depends on a method existing called class_name.

[ GitHub ]

  
# File 'lib/minitest.rb', line 464

def location
  loc = " [#{self.failure.location}]" unless passed? or error?
  "#{self.class_name}##{self.name}#{loc}"
end

#result_code

Returns “.”, “F”, or “E” based on the result of the run.

[ GitHub ]

  
# File 'lib/minitest.rb', line 476

def result_code
  self.failure and self.failure.result_code or "."
end