diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 23:28:35 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 23:28:35 +0000 |
commit | 9ca563978e31b308f0e19fea597188a6495e2a7c (patch) | |
tree | 2221e497df9cf17636fab3f3b3734903e753285b | |
parent | 7ad94af99b237460eb86e0de5828ed9f45f561b2 (diff) | |
download | ruby-9ca563978e31b308f0e19fea597188a6495e2a7c.tar.gz |
Fix some test failures in RubyGems.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/rubygems.rb | 10 | ||||
-rw-r--r-- | test/rubygems/test_gem.rb | 4 |
3 files changed, 17 insertions, 3 deletions
@@ -1,3 +1,9 @@ +Tue Dec 25 08:27:43 2007 Eric Hodel <drbrain@segment7.net> + + * lib/rubygems.rb: Fix test failures. + + * test/rubygems/test_gem.rb: Fix test failure. + Tue Dec 25 06:23:40 2007 Koichi Sasada <ko1@atdot.net> * bootstraptest/test_knownbug.rb, test_literal.rb: move fixed test. diff --git a/lib/rubygems.rb b/lib/rubygems.rb index cc8066858c..e25e05a3b8 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -345,9 +345,15 @@ module Gem end sitelibdir = ConfigMap[:sitelibdir] + sitelibdir_index = $LOAD_PATH.index sitelibdir - # gem directories must come after -I and ENV['RUBYLIB'] - $:.insert($:.index(sitelibdir), *require_paths) + if sitelibdir_index then + # gem directories must come after -I and ENV['RUBYLIB'] + $LOAD_PATH.insert(sitelibdir_index, *require_paths) + else + # we are probably testing in core, -I and RUBYLIB don't apply + $LOAD_PATH.unshift(*require_paths) + end # Now autorequire if autorequire && spec.autorequire then # DEPRECATED diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index 27f10e49b4..41b127ce39 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -280,7 +280,9 @@ class TestGem < RubyGemTestCase def test_self_prefix file_name = File.expand_path __FILE__ - assert_equal File.dirname(File.dirname(file_name)), Gem.prefix + expected = File.dirname File.dirname(file_name) + expected = File.dirname expected if expected =~ %r|/test| # for Ruby trunk + assert_equal expected, Gem.prefix end def test_self_required_location |