1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Don't require rubygems/defaults from gem_prelude.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2008-10-31 22:27:35 +00:00
parent ff5a076e7e
commit af0221e728
5 changed files with 139 additions and 9 deletions

View file

@ -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