summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-31 22:27:35 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-31 22:27:35 +0000
commitcc804ab45ac86f21132cf4de886333671a1ecfad (patch)
treef857a455a6627484a5e790eedee57cf8fcbdd22e /test
parent57fd5212bd81b50bd99af190fbef94844c23a50b (diff)
downloadruby-cc804ab45ac86f21132cf4de886333671a1ecfad.tar.gz
ruby-cc804ab45ac86f21132cf4de886333671a1ecfad.tar.xz
ruby-cc804ab45ac86f21132cf4de886333671a1ecfad.zip
Don't require rubygems/defaults from gem_prelude.rb.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/rubygems/test_gem.rb27
1 files changed, 26 insertions, 1 deletions
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
index 242d0cee6..f5bfa28e5 100644
--- a/test/rubygems/test_gem.rb
+++ b/test/rubygems/test_gem.rb
@@ -11,7 +11,11 @@ class TestGem < RubyGemTestCase
super
@additional = %w[a b].map { |d| File.join @tempdir, d }
- @default_dir_re = %r|/\.*?[Rr]uby.*?/[Gg]ems/[0-9.]+|
+ @default_dir_re = if RUBY_VERSION > '1.9' then
+ %r|/.*?[Rr]uby.*?/[Gg]ems/[0-9.]+|
+ else
+ %r|/[Rr]uby/[Gg]ems/[0-9.]+|
+ end
end
def test_self_all_load_paths
@@ -475,6 +479,27 @@ class TestGem < RubyGemTestCase
assert_kind_of Gem::GemPathSearcher, Gem.searcher
end
+ def test_self_set_paths
+ other = File.join @tempdir, 'other'
+ path = [@userhome, other].join File::PATH_SEPARATOR
+ Gem.send :set_paths, path
+
+ assert File.exist?(File.join(@userhome, 'gems'))
+ assert File.exist?(File.join(other, 'gems'))
+ end
+
+ def test_self_set_paths_nonexistent_home
+ Gem.clear_paths
+
+ other = File.join @tempdir, 'other'
+
+ ENV['HOME'] = other
+
+ Gem.send :set_paths, other
+
+ refute File.exist?(File.join(other, 'gems'))
+ end
+
def test_self_source_index
assert_kind_of Gem::SourceIndex, Gem.source_index
end