diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-12 17:31:15 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-12 17:31:15 +0000 |
commit | 272560359a3ec52a00de51b5c8d01fe72d44348d (patch) | |
tree | a0362a3e1dfecded44cb7b790aec9ccf8f3785f1 /lib/test/unit/collector | |
parent | d947750eb067f092c90122366a1ee57d2c8fc808 (diff) | |
download | ruby-272560359a3ec52a00de51b5c8d01fe72d44348d.tar.gz |
* lib/test/unit/collector/dir.rb (Collector::Dir#collect): prepend
base directory to load path.
* lib/test/unit/collector/dir.rb (Collector::Dir#collect_file): should
use the given File-like interface, but not File directly.
* test/testunit/collector/test_dir.rb (TestDir::FileSystem): implement
File-like methods correctly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/test/unit/collector')
-rw-r--r-- | lib/test/unit/collector/dir.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/test/unit/collector/dir.rb b/lib/test/unit/collector/dir.rb index dadd9408c7..4e553db4df 100644 --- a/lib/test/unit/collector/dir.rb +++ b/lib/test/unit/collector/dir.rb @@ -21,6 +21,8 @@ module Test end def collect(*from) + basedir = @base + $:.unshift(basedir) if basedir if(from.empty?) recursive_collect('.', find_test_cases) elsif(from.size == 1) @@ -35,6 +37,8 @@ module Test sort(suites).each{|s| suite << s} suite end + ensure + $:.delete_at($:.rindex(basedir)) if basedir end def find_test_cases(ignore=[]) @@ -77,7 +81,7 @@ module Test end def collect_file(name, suites, already_gathered) - dir = File.dirname(name = File.expand_path(name, @base)) + dir = @file.dirname(@file.expand_path(name, @base)) $:.unshift(dir) if(@req) @req.require(name) |