test helper
I added assert_empty to check that an array is empty.
But the line number from test helper.rb was the first line of the test helper, not the line in the test.
Instead, I wanted to see the actual failure as the first line. Welcome remove_me_from_trace(exception)
class Test::Unit::TestCase
def assert_empty(*args)
begin
args.unshift []
assert_equal *args
rescue => e
raise remove_me_from_trace(e)
end
end
def remove_me_from_trace(e)
x=e.backtrace.shift until (x =~ /test_helper.rb/ )
e
end
end