summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-31 13:57:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-31 13:57:34 +0000
commit4c1afa78aa992df91acd5cdedfd1ccf3b33352f0 (patch)
treed07dc94b6c1e6eeb1d2c6a2d6b766e843cbe7397 /test
parentdc0991c8d8e9d9d6362475d0bc719de54af8b5a0 (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_backtrace.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/ruby/test_backtrace.rb b/test/ruby/test_backtrace.rb
index b9fb8a1..9116e0a 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