Module: Minitest

Defined in:
lib/enhanced/minitest_patch.rb

Class Method Summary collapse

Class Method Details

.original_run_one_methodObject



3
# File 'lib/enhanced/minitest_patch.rb', line 3

alias_method :original_run_one_method, :run_one_method

.run_one_method(klass, method_name) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/enhanced/minitest_patch.rb', line 5

def run_one_method(klass, method_name)
  EnhancedErrors.start_minitest_binding_capture
  result = original_run_one_method(klass, method_name)
ensure
  begin
    binding_infos = EnhancedErrors.stop_minitest_binding_capture
    EnhancedErrors.override_exception_message(result.failures.last, binding_infos) if result.failures.any?
  rescue => e
    puts "Ignored error during error enhancement: #{e}"
  end
end