1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_backtrace.rb: split test

* test/ruby/test_backtrace.rb (test_caller_locations_absolute_path):
  split from test_caller_locations_path.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-01-31 13:57:34 +00:00
parent dc0991c8d8
commit 4c1afa78aa

View file

@ -167,12 +167,21 @@ class TestBacktrace < Test::Unit::TestCase
def test_caller_locations_path
loc, = caller_locations(0, 1)
assert_equal(__FILE__, loc.path)
Tempfile.create(%w"caller_locations .rb") do |f|
f.puts "caller_locations(0, 1)[0].tap {|loc| puts loc.path}"
f.close
dir, base = File.split(f.path)
assert_in_out_err(["-C", dir, base], "", [base])
end
end
def test_caller_locations_absolute_path
loc, = caller_locations(0, 1)
assert_equal(__FILE__, loc.absolute_path)
Tempfile.create(%w"caller_locations .rb") do |f|
f.puts "caller_locations(0, 1)[0].tap {|loc| puts loc.path, loc.absolute_path}"
f.puts "caller_locations(0, 1)[0].tap {|loc| puts loc.absolute_path}"
f.close
path = f.path
assert_in_out_err(["-C", *File.split(path)], "", [File.basename(f.path), File.realpath(f.path)])
assert_in_out_err(["-C", *File.split(f.path)], "", [File.realpath(f.path)])
end
end