summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-21 06:57:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-21 06:57:14 +0000
commit8af34b7b33714eeb0f0dead1ce79a98b780ddb22 (patch)
tree4688f77e5b9e3a1da46d9671288dd00a36107e6e
parent9292a6254e40e2e76a53e3c1ae31cbc01e8e0958 (diff)
* lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir#collect_file):
prepend the directory of target file to the load path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/test/unit/collector/dir.rb4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a9bd74c03..8f432455a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Oct 21 15:57:11 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir#collect_file):
+ prepend the directory of target file to the load path.
+
Tue Oct 21 15:08:53 2003 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (do_spawn, do_aspawn): should wait child process even
diff --git a/lib/test/unit/collector/dir.rb b/lib/test/unit/collector/dir.rb
index b5c935519e..7a9bde891b 100644
--- a/lib/test/unit/collector/dir.rb
+++ b/lib/test/unit/collector/dir.rb
@@ -67,12 +67,16 @@ module Test
end
def collect_file(name, suites, already_gathered)
+ loadpath = $:.dup
+ $:.unshift(File.dirname(name))
if(@req)
@req.require(name)
else
require(name)
end
find_test_cases(already_gathered).each{|t| add_suite(suites, t.suite)}
+ ensure
+ $:.replace(loadpath)
end
end
end