summaryrefslogtreecommitdiff
path: root/lib/test/unit/collector/dir.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/test/unit/collector/dir.rb')
-rw-r--r--lib/test/unit/collector/dir.rb4
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