ruby-changes:25613
From: naruse <ko1@a...>
Date: Fri, 16 Nov 2012 12:49:22 +0900 (JST)
Subject: [ruby-changes:25613] naruse:r37670 (trunk): * test/rake/helper.rb (Rake::TestCase#setup): revert r37669.
naruse 2012-11-16 12:49:09 +0900 (Fri, 16 Nov 2012) New Revision: 37670 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37670 Log: * 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. Modified files: trunk/ChangeLog trunk/test/rake/helper.rb trunk/test/rake/test_rake_backtrace.rb trunk/test/rake/test_rake_file_task.rb trunk/test/rake/test_rake_functional.rb trunk/test/rake/test_rake_rake_test_loader.rb trunk/test/rake/test_rake_reduce_compat.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 37669) +++ ChangeLog (revision 37670) @@ -1,3 +1,11 @@ +Fri Nov 16 12:36:47 2012 NARUSE, Yui <naruse@r...> + + * 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. + Fri Nov 16 10:22:52 2012 NARUSE, Yui <naruse@r...> * test/rake/helper.rb (Rake::TestCase#setup): @orig_PWD shouldn't be Index: test/rake/test_rake_functional.rb =================================================================== --- test/rake/test_rake_functional.rb (revision 37669) +++ test/rake/test_rake_functional.rb (revision 37670) @@ -5,8 +5,8 @@ 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'] Index: test/rake/test_rake_reduce_compat.rb =================================================================== --- test/rake/test_rake_reduce_compat.rb (revision 37669) +++ test/rake/test_rake_reduce_compat.rb (revision 37670) @@ -4,8 +4,8 @@ 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 Index: test/rake/helper.rb =================================================================== --- test/rake/helper.rb (revision 37669) +++ test/rake/helper.rb (revision 37670) @@ -31,7 +31,7 @@ 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'] Index: test/rake/test_rake_backtrace.rb =================================================================== --- test/rake/test_rake_backtrace.rb (revision 37669) +++ test/rake/test_rake_backtrace.rb (revision 37670) @@ -4,8 +4,8 @@ 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 Index: test/rake/test_rake_file_task.rb =================================================================== --- test/rake/test_rake_file_task.rb (revision 37669) +++ test/rake/test_rake_file_task.rb (revision 37670) @@ -116,7 +116,7 @@ end def load_phony - load File.join(@orig_PWD, "lib/rake/phony.rb") + load File.expand_path('../../../lib/rake/phony.rb', __FILE__) end end Index: test/rake/test_rake_rake_test_loader.rb =================================================================== --- test/rake/test_rake_rake_test_loader.rb (revision 37669) +++ test/rake/test_rake_rake_test_loader.rb (revision 37670) @@ -10,7 +10,7 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/