diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-04 13:36:46 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-04 13:36:46 +0000 |
commit | 7455071a4f678c8926f397e5c4294879c51a130d (patch) | |
tree | 2322d7037d2302705345c6b0a52baa9f37a20ddc /test/rubygems | |
parent | 185e9ae27c9bc441ddadd73a55f7c262021aee57 (diff) |
merges r20085 from trunk into ruby_1_9_1.
* Don't require rubygems/defaults from gem_prelude.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems')
-rw-r--r-- | test/rubygems/test_gem.rb | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index 242d0cee60..f5bfa28e54 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 |