diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-31 22:27:35 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-31 22:27:35 +0000 |
commit | af0221e728742adb34aa5e2abfcefa899ccd1867 (patch) | |
tree | f857a455a6627484a5e790eedee57cf8fcbdd22e /test/rubygems | |
parent | ff5a076e7e1dbe8f255cb23a03be006fded7d277 (diff) | |
download | ruby-af0221e728742adb34aa5e2abfcefa899ccd1867.tar.gz |
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
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 |