From 4c1afa78aa992df91acd5cdedfd1ccf3b33352f0 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 31 Jan 2015 13:57:34 +0000 Subject: 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 --- test/ruby/test_backtrace.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/ruby/test_backtrace.rb b/test/ruby/test_backtrace.rb index b9fb8a19d1..9116e0a32a 100644 --- a/test/ruby/test_backtrace.rb +++ b/test/ruby/test_backtrace.rb @@ -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 -- cgit v1.2.3