Class: MiniTest::Unit

Inherits:
Object show all
Defined in:
lib/minitest/should_syntax.rb

Overview

Patch #location() to ignore should_syntax.

Instance Method Summary collapse

Instance Method Details

#location(e) ⇒ Object

:nodoc:



179
180
181
182
183
184
185
186
# File 'lib/minitest/should_syntax.rb', line 179

def location(e) # :nodoc:
  last_before_assertion = ""
  e.backtrace.reverse_each do |s|
    break if s =~ /(in .(assert|refute|flunk|pass|fail|raise|must|wont))|(minitest\/should_syntax)/
    last_before_assertion = s
  end
  last_before_assertion.sub(/:in .*$/, '')
end