summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-25 16:52:03 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-25 16:57:37 +0900
commit46771abfe53d95e8cecf917a5c999e32388be184 (patch)
tree8eb9d54822c913360eda92667bbdb757f6bf7fee /tool
parent4c1db84d1748b56334da8293ee328186fcb08162 (diff)
Use libraries in the base directory if given
Diffstat (limited to 'tool')
-rw-r--r--tool/lib/test/unit.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb
index a3e41a840e..37c17babb4 100644
--- a/tool/lib/test/unit.rb
+++ b/tool/lib/test/unit.rb
@@ -1123,10 +1123,11 @@ module Test
def initialize(force_standalone = false, default_dir = nil, argv = ARGV)
@force_standalone = force_standalone
@runner = Runner.new do |files, options|
- options[:base_directory] ||= default_dir
+ base = options[:base_directory] ||= default_dir
files << default_dir if files.empty? and default_dir
@to_run = files
yield self if block_given?
+ $LOAD_PATH.unshift base if base
files
end
Runner.runner = @runner