summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-04 18:28:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-04 18:28:49 +0000
commit93b9f2cc5ef029d4cdeab7637fd419580af57d79 (patch)
treeb44f957e4fd89f7f1bf2a638e6708652b2d5797b
parent528574c2e21e25fe1f848f77f4e7606636a7a2dc (diff)
* lib/test/unit.rb (Test::Unit.setup_argv): expands paths before
requiring. [ruby-dev:39012] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/test/unit.rb6
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e5e198d517b..35b939ea2e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Aug 5 03:28:41 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit.setup_argv): expands paths before
+ requiring. [ruby-dev:39012]
+
Wed Aug 5 01:38:27 2009 Yusuke Endoh <mame@tsg.ne.jp>
* lib/pp.rb (guard_inspect_key): untrust internal hash to prevent
diff --git a/lib/test/unit.rb b/lib/test/unit.rb
index 3e2b3882731..fd7fe06f43d 100644
--- a/lib/test/unit.rb
+++ b/lib/test/unit.rb
@@ -32,7 +32,7 @@ module Test
end
files.map! {|f|
- f = f.gsub(Regexp.compile(Regexp.quote(File::ALT_SEPARATOR)), File::SEPARATOR) if File::ALT_SEPARATOR
+ f = f.tr(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
if File.directory? f
Dir["#{f}/**/test_*.rb"]
elsif File.file? f
@@ -47,12 +47,12 @@ module Test
files.reject! {|f| reject_pat =~ f }
files.each {|f|
- d = File.dirname(File.expand_path(f))
+ d = File.dirname(path = File.expand_path(f))
unless $:.include? d
$: << d
end
begin
- require f
+ require path
rescue LoadError
puts "#{f}: #{$!}"
end