class Object

Public Instance Methods

format_rerun_snippet(result) click to toggle source

Fix format_rerun_snippet so that it works with recent versions of Minitest. This was cribbed from: <github.com/rails/rails/commit/ff0d5f14504f1aa29ad908ab15bab66b101427b7#diff-a071a1c8f51ce3b8bcb17ca59c79fc70>

# File lib/shoulda/context/rails_test_unit_reporter_patch.rb, line 8
def format_rerun_snippet(result)
  location, line =
    if result.respond_to?(:source_location)
      result.source_location
    else
      result.method(result.name).source_location
    end

  "#{executable} #{relative_path_for(location)}:#{line}"
end