diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-16 03:49:09 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-16 03:49:09 +0000 |
commit | a632fe43d837f3cb05ed35012327aa60c37919b7 (patch) | |
tree | 0294493ad49772908be3faf2616451c8e380c145 /test/rake | |
parent | 48aab9e032f7deca5ccc994356428c86f75ef2f7 (diff) |
* test/rake/helper.rb (Rake::TestCase#setup): revert r37669.
@orig_PWD should be the original pwd.
* test/rake/test_*.rb: don't use @orig_PWD to load libraries.
It should be specified with relative path from the file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rake')
-rw-r--r-- | test/rake/helper.rb | 2 | ||||
-rw-r--r-- | test/rake/test_rake_backtrace.rb | 4 | ||||
-rw-r--r-- | test/rake/test_rake_file_task.rb | 2 | ||||
-rw-r--r-- | test/rake/test_rake_functional.rb | 4 | ||||
-rw-r--r-- | test/rake/test_rake_rake_test_loader.rb | 2 | ||||
-rw-r--r-- | test/rake/test_rake_reduce_compat.rb | 4 |
6 files changed, 9 insertions, 9 deletions
diff --git a/test/rake/helper.rb b/test/rake/helper.rb index b54390e0b8..288ff0e3b2 100644 --- a/test/rake/helper.rb +++ b/test/rake/helper.rb @@ -31,7 +31,7 @@ class Rake::TestCase < MiniTest::Unit::TestCase def setup ARGV.clear - @orig_PWD = File.expand_path('../../..', __FILE__) + @orig_PWD = Dir.pwd @orig_APPDATA = ENV['APPDATA'] @orig_HOME = ENV['HOME'] @orig_HOMEDRIVE = ENV['HOMEDRIVE'] diff --git a/test/rake/test_rake_backtrace.rb b/test/rake/test_rake_backtrace.rb index 4d84becf98..8fcf813316 100644 --- a/test/rake/test_rake_backtrace.rb +++ b/test/rake/test_rake_backtrace.rb @@ -4,8 +4,8 @@ require 'open3' class TestRakeBacktrace < Rake::TestCase # TODO: factor out similar code in test_rake_functional.rb def rake(*args) - lib = File.join(@orig_PWD, "lib") - bin_rake = File.join(@orig_PWD, "bin", "rake") + lib = File.expand_path('../../../lib', __FILE__) + bin_rake = File.expand_path('../../../bin/rake', __FILE__) Open3.popen3(RUBY, "-I", lib, bin_rake, *args) { |_, _, err, _| err.read } end diff --git a/test/rake/test_rake_file_task.rb b/test/rake/test_rake_file_task.rb index a46851bd01..1935c8082a 100644 --- a/test/rake/test_rake_file_task.rb +++ b/test/rake/test_rake_file_task.rb @@ -116,7 +116,7 @@ class TestRakeFileTask < Rake::TestCase end def load_phony - load File.join(@orig_PWD, "lib/rake/phony.rb") + load File.expand_path('../../../lib/rake/phony.rb', __FILE__) end end diff --git a/test/rake/test_rake_functional.rb b/test/rake/test_rake_functional.rb index 2b97927e4c..90e4064fbe 100644 --- a/test/rake/test_rake_functional.rb +++ b/test/rake/test_rake_functional.rb @@ -5,8 +5,8 @@ require 'open3' class TestRakeFunctional < Rake::TestCase def setup - @rake_path = File.expand_path("bin/rake") - lib_path = File.expand_path("lib") + @rake_path = File.expand_path("../../../bin/rake", __FILE__) + lib_path = File.expand_path("../../../lib", __FILE__) @ruby_options = ["-I#{lib_path}", "-I."] @verbose = ENV['VERBOSE'] diff --git a/test/rake/test_rake_rake_test_loader.rb b/test/rake/test_rake_rake_test_loader.rb index 5b5e81d06d..be3c7da61f 100644 --- a/test/rake/test_rake_rake_test_loader.rb +++ b/test/rake/test_rake_rake_test_loader.rb @@ -10,7 +10,7 @@ class TestRakeRakeTestLoader < Rake::TestCase ARGV.replace %w[foo.rb test_*.rb -v] - load File.join(@orig_PWD, 'lib/rake/rake_test_loader.rb') + load File.expand_path('../../../lib/rake/rake_test_loader.rb', __FILE__) assert_equal %w[-v], ARGV ensure diff --git a/test/rake/test_rake_reduce_compat.rb b/test/rake/test_rake_reduce_compat.rb index 12872614db..6ce42b9f8e 100644 --- a/test/rake/test_rake_reduce_compat.rb +++ b/test/rake/test_rake_reduce_compat.rb @@ -4,8 +4,8 @@ require 'open3' class TestRakeReduceCompat < Rake::TestCase # TODO: factor out similar code in test_rake_functional.rb def rake(*args) - lib = File.join(@orig_PWD, "lib") - bin_rake = File.join(@orig_PWD, "bin", "rake") + lib = File.expand_path('../../../lib', __FILE__) + bin_rake = File.expand_path('../../../bin/rake', __FILE__) Open3.popen3(RUBY, "-I", lib, bin_rake, *args) { |_, out, _, _| out.read } end |