mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 00:54:01 +02:00
* 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/branches/ruby_1_8@11147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
98716977c4
commit
11a696870a
3 changed files with 39 additions and 7 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue