summaryrefslogtreecommitdiff
path: root/test/minitest
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-27 02:39:17 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-27 02:39:17 +0000
commitafea4a499510483975b88491af51ed8674261489 (patch)
tree9d8c86dbc61c6fc487d256ff1d729a79705733a1 /test/minitest
parent83acdeedd834381ac996282ae3a3257bc531cd1a (diff)
* test/minitest/test_mini_test.rb (test_filter_backtrace):
fixed failure on Ruby built at out of $(srcdir). * test/minitest/test_mini_test.rb (test_Filter_backtrace_unit_starts): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/minitest')
-rw-r--r--test/minitest/test_mini_test.rb25
1 files changed, 14 insertions, 11 deletions
diff --git a/test/minitest/test_mini_test.rb b/test/minitest/test_mini_test.rb
index 8561acb..6c3a2c4 100644
--- a/test/minitest/test_mini_test.rb
+++ b/test/minitest/test_mini_test.rb
@@ -5,6 +5,7 @@
############################################################
require 'stringio'
+require 'pathname'
require 'minitest/unit'
MiniTest::Unit.autorun
@@ -27,22 +28,24 @@ class TestMiniTest < MiniTest::Unit::TestCase
Object.send :remove_const, :ATestCase if defined? ATestCase
end
- BT_MIDDLE = ["./lib/mini/test.rb:165:in `run_test_suites'",
- "./lib/mini/test.rb:161:in `each'",
- "./lib/mini/test.rb:161:in `run_test_suites'",
- "./lib/mini/test.rb:158:in `each'",
- "./lib/mini/test.rb:158:in `run_test_suites'",
- "./lib/mini/test.rb:139:in `run'",
- "./lib/mini/test.rb:106:in `run'"]
+ pwd = Pathname.new(Dir.pwd)
+ MINITEST_BASE_DIR = Pathname.new(File.expand_path(MiniTest::MINI_DIR)).relative_path_from(pwd)
+ BT_MIDDLE = ["#{MINITEST_BASE_DIR}/test.rb:165:in `run_test_suites'",
+ "#{MINITEST_BASE_DIR}/test.rb:161:in `each'",
+ "#{MINITEST_BASE_DIR}/test.rb:161:in `run_test_suites'",
+ "#{MINITEST_BASE_DIR}/test.rb:158:in `each'",
+ "#{MINITEST_BASE_DIR}/test.rb:158:in `run_test_suites'",
+ "#{MINITEST_BASE_DIR}/test.rb:139:in `run'",
+ "#{MINITEST_BASE_DIR}/test.rb:106:in `run'"]
def test_filter_backtrace
# this is a semi-lame mix of relative paths.
# I cheated by making the autotest parts not have ./
bt = (["lib/autotest.rb:571:in `add_exception'",
"test/test_autotest.rb:62:in `test_add_exception'",
- "./lib/mini/test.rb:165:in `__send__'"] +
+ "#{MINITEST_BASE_DIR}/test.rb:165:in `__send__'"] +
BT_MIDDLE +
- ["./lib/mini/test.rb:29",
+ ["#{MINITEST_BASE_DIR}/test.rb:29",
"test/test_autotest.rb:422"])
bt = util_expand_bt bt
@@ -73,9 +76,9 @@ class TestMiniTest < MiniTest::Unit::TestCase
end
def test_filter_backtrace_unit_starts
- bt = (["./lib/mini/test.rb:165:in `__send__'"] +
+ bt = (["#{MINITEST_BASE_DIR}/test.rb:165:in `__send__'"] +
BT_MIDDLE +
- ["./lib/mini/test.rb:29",
+ ["#{MINITEST_BASE_DIR}/mini/test.rb:29",
"-e:1"])
bt = util_expand_bt bt