Module: Mocha::Integration::MiniTest

Defined in:
lib/mocha/integration/mini_test/version_13.rb,
lib/mocha/integration/mini_test/version_140.rb,
lib/mocha/integration/mini_test/version_200.rb,
lib/mocha/integration/mini_test/version_141.rb,
lib/mocha/integration/mini_test/assertion_counter.rb,
lib/mocha/integration/mini_test/version_230_to_262.rb,
lib/mocha/integration/mini_test/version_201_to_222.rb,
lib/mocha/integration/mini_test/version_142_to_172.rb,
lib/mocha/integration/mini_test/exception_translation.rb

Defined Under Namespace

Modules: Version13, Version140, Version141, Version142To172, Version200, Version201To222, Version230To262 Classes: AssertionCounter

Class Method Summary collapse

Class Method Details

.translate(exception) ⇒ Object


9
10
11
12
13
14
# File 'lib/mocha/integration/mini_test/exception_translation.rb', line 9

def self.translate(exception)
  return exception unless exception.kind_of?(::Mocha::ExpectationError)
  translated_exception = ::MiniTest::Assertion.new(exception.message)
  translated_exception.set_backtrace(exception.backtrace)
  translated_exception
end