module Minitest::Reportable

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

Public Instance Methods

error?() Show source
# File lib/minitest.rb, line 484
def error?
  self.failures.any? { |f| UnexpectedError === f }
end

Did this run error?

location() Show source
# File lib/minitest.rb, line 458
def location
  loc = " [#{self.failure.location}]" unless passed? or error?
  "#{self.class_name}##{self.name}#{loc}"
end

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

passed?() Show source
# File lib/minitest.rb, line 450
def passed?
  not self.failure
end

Did this run pass?

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

result_code() Show source
# File lib/minitest.rb, line 470
def result_code
  self.failure and self.failure.result_code or "."
end

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

skipped?() Show source
# File lib/minitest.rb, line 477
def skipped?
  self.failure and Skip === self.failure
end

Was this run skipped?

© Ryan Davis, seattle.rb
Licensed under the MIT License.