diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-21 06:57:14 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-21 06:57:14 +0000 |
commit | 8af34b7b33714eeb0f0dead1ce79a98b780ddb22 (patch) | |
tree | 4688f77e5b9e3a1da46d9671288dd00a36107e6e /lib/test | |
parent | 9292a6254e40e2e76a53e3c1ae31cbc01e8e0958 (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
Diffstat (limited to 'lib/test')
-rw-r--r-- | lib/test/unit/collector/dir.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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 |