summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-22 01:59:18 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-22 01:59:18 +0000
commit05184578d77e81c0e3e0940eb3f40d2a1ce99dcd (patch)
treeab75f05157b908016974719c4e783c9205db6bc1
parent2c1936cf87184470308b6bf3f0fe70f1a99936af (diff)
* test/runner.rb: set Gem::TestCase's @@project_dir.
* lib/rubygems/test_case.rb: set Gem::TestCase's @@project_dir only when it is not defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--lib/rubygems/test_case.rb2
-rw-r--r--test/runner.rb3
3 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e12e6138c3..b0279ad1fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Mar 22 10:57:36 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/runner.rb: set Gem::TestCase's @@project_dir.
+
+ * lib/rubygems/test_case.rb: set Gem::TestCase's @@project_dir only
+ when it is not defined.
+
Tue Mar 22 09:38:19 2011 NARUSE, Yui <naruse@ruby-lang.org>
* numeric.c (flo_round): use pow instead of while-loop. fixes #4510
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index 0f3b892eb1..3b6b3c7f7f 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -87,7 +87,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
undef_method :default_test if instance_methods.include? 'default_test' or
instance_methods.include? :default_test
- @@project_dir = Dir.pwd
+ @@project_dir = Dir.pwd unless defined?(@@project_dir)
##
# #setup prepares a sandboxed location to install gems. All installs are
diff --git a/test/runner.rb b/test/runner.rb
index 93eb98c0b2..608af08922 100644
--- a/test/runner.rb
+++ b/test/runner.rb
@@ -4,6 +4,9 @@ require 'test/unit'
src_testdir = File.dirname(File.expand_path(__FILE__))
$LOAD_PATH << src_testdir
+class Gem::TestCase < MiniTest::Unit::TestCase
+ @@project_dir = File.dirname($LOAD_PATH.last)
+end
require_relative 'profile_test_all' if ENV['RUBY_TEST_ALL_PROFILE'] == 'true'