mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
48aab9e032
commit
a632fe43d8
7 changed files with 17 additions and 9 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Fri Nov 16 12:36:47 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Fri Nov 16 10:22:52 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* test/rake/helper.rb (Rake::TestCase#setup): @orig_PWD shouldn't be
|
* test/rake/helper.rb (Rake::TestCase#setup): @orig_PWD shouldn't be
|
||||||
|
|
|
@ -31,7 +31,7 @@ class Rake::TestCase < MiniTest::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
ARGV.clear
|
ARGV.clear
|
||||||
|
|
||||||
@orig_PWD = File.expand_path('../../..', __FILE__)
|
@orig_PWD = Dir.pwd
|
||||||
@orig_APPDATA = ENV['APPDATA']
|
@orig_APPDATA = ENV['APPDATA']
|
||||||
@orig_HOME = ENV['HOME']
|
@orig_HOME = ENV['HOME']
|
||||||
@orig_HOMEDRIVE = ENV['HOMEDRIVE']
|
@orig_HOMEDRIVE = ENV['HOMEDRIVE']
|
||||||
|
|
|
@ -4,8 +4,8 @@ require 'open3'
|
||||||
class TestRakeBacktrace < Rake::TestCase
|
class TestRakeBacktrace < Rake::TestCase
|
||||||
# TODO: factor out similar code in test_rake_functional.rb
|
# TODO: factor out similar code in test_rake_functional.rb
|
||||||
def rake(*args)
|
def rake(*args)
|
||||||
lib = File.join(@orig_PWD, "lib")
|
lib = File.expand_path('../../../lib', __FILE__)
|
||||||
bin_rake = File.join(@orig_PWD, "bin", "rake")
|
bin_rake = File.expand_path('../../../bin/rake', __FILE__)
|
||||||
Open3.popen3(RUBY, "-I", lib, bin_rake, *args) { |_, _, err, _| err.read }
|
Open3.popen3(RUBY, "-I", lib, bin_rake, *args) { |_, _, err, _| err.read }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ class TestRakeFileTask < Rake::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_phony
|
def load_phony
|
||||||
load File.join(@orig_PWD, "lib/rake/phony.rb")
|
load File.expand_path('../../../lib/rake/phony.rb', __FILE__)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,8 +5,8 @@ require 'open3'
|
||||||
class TestRakeFunctional < Rake::TestCase
|
class TestRakeFunctional < Rake::TestCase
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@rake_path = File.expand_path("bin/rake")
|
@rake_path = File.expand_path("../../../bin/rake", __FILE__)
|
||||||
lib_path = File.expand_path("lib")
|
lib_path = File.expand_path("../../../lib", __FILE__)
|
||||||
@ruby_options = ["-I#{lib_path}", "-I."]
|
@ruby_options = ["-I#{lib_path}", "-I."]
|
||||||
@verbose = ENV['VERBOSE']
|
@verbose = ENV['VERBOSE']
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ class TestRakeRakeTestLoader < Rake::TestCase
|
||||||
|
|
||||||
ARGV.replace %w[foo.rb test_*.rb -v]
|
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
|
assert_equal %w[-v], ARGV
|
||||||
ensure
|
ensure
|
||||||
|
|
|
@ -4,8 +4,8 @@ require 'open3'
|
||||||
class TestRakeReduceCompat < Rake::TestCase
|
class TestRakeReduceCompat < Rake::TestCase
|
||||||
# TODO: factor out similar code in test_rake_functional.rb
|
# TODO: factor out similar code in test_rake_functional.rb
|
||||||
def rake(*args)
|
def rake(*args)
|
||||||
lib = File.join(@orig_PWD, "lib")
|
lib = File.expand_path('../../../lib', __FILE__)
|
||||||
bin_rake = File.join(@orig_PWD, "bin", "rake")
|
bin_rake = File.expand_path('../../../bin/rake', __FILE__)
|
||||||
Open3.popen3(RUBY, "-I", lib, bin_rake, *args) { |_, out, _, _| out.read }
|
Open3.popen3(RUBY, "-I", lib, bin_rake, *args) { |_, out, _, _| out.read }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue