ruby-changes:37380
From: nobu <ko1@a...>
Date: Sat, 31 Jan 2015 22:57:49 +0900 (JST)
Subject: [ruby-changes:37380] nobu:r49461 (trunk): test_backtrace.rb: split test
nobu 2015-01-31 22:57:34 +0900 (Sat, 31 Jan 2015) New Revision: 49461 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49461 Log: test_backtrace.rb: split test * test/ruby/test_backtrace.rb (test_caller_locations_absolute_path): split from test_caller_locations_path. Modified files: trunk/test/ruby/test_backtrace.rb Index: test/ruby/test_backtrace.rb =================================================================== --- test/ruby/test_backtrace.rb (revision 49460) +++ test/ruby/test_backtrace.rb (revision 49461) @@ -167,12 +167,21 @@ class TestBacktrace < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/ruby/test_backtrace.rb#L167 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/