Method: Tunit::Assertion#location

Defined in:
lib/tunit/assertion_errors.rb

#locationObject



7
8
9
10
11
12
13
14
# File 'lib/tunit/assertion_errors.rb', line 7

def location
  last_before_assertion = ""
  self.backtrace.reverse_each do |line|
    break if line =~ /in .(assert|refute|pass|raise)/
    last_before_assertion = line
  end
  last_before_assertion.sub(/:in .*$/, "")
end