Permalink
Browse files

Switch the tests over to using Gem.user_dir

git-svn-id: http://rubygems.rubyforge.org/svn/trunk@1839 3d4018f9-ac1a-0410-99e9-8a154d859a19
  • Loading branch information...
technomancy
technomancy committed Jul 2, 2008
1 parent b730cdf commit 8e701b546c1b73cd7346ad17837d102d17046c85
Showing with 18 additions and 15 deletions.
  1. +6 −0 ChangeLog
  2. +5 −0 test/test_gem.rb
  3. +2 −4 test/test_gem_install_update_options.rb
  4. +4 −9 test/test_gem_installer.rb
  5. +1 −2 test/test_gem_remote_fetcher.rb
View
@@ -1,4 +1,10 @@
# -*- coding: utf-8 -*-
+2008-07-02 Phil Hagelberg <technomancy@gmail.com>
+
+ * lib/rubygems/defaults.rb: Add Gem.user_dir to use paths like
+ ~/.gem/ruby/1.8/gems and the like instead of just ~/.gem. Update
+ remote fetcher and installer to use it.
+
2008-07-01 Eric Hodel <drbrain@segment7.net>
* lib/rubygems/installer.rb: Add #gem_home, #bin_dir for hooks. Use
View
@@ -428,6 +428,11 @@ def test_self_use_paths
assert_equal @additional + [Gem.dir], Gem.path
end
+ def test_self_user_dir
+ assert_equal File.join(@userhome, '.gem', Gem.ruby_engine,
+ Gem::ConfigMap[:ruby_version]), Gem.user_dir
+ end
+
def test_self_user_home
if ENV['HOME'] then
assert_equal ENV['HOME'], Gem.user_home
@@ -41,10 +41,8 @@ def test_user_install_enabled
@installer = Gem::Installer.new @gem, @cmd.options
@installer.install
- assert File.exist?(File.join(@userhome, '.gem', Gem.ruby_engine,
- Gem::ConfigMap[:ruby_version], 'gems'))
- assert File.exist?(File.join(@userhome, '.gem', Gem.ruby_engine,
- Gem::ConfigMap[:ruby_version], 'gems',
+ assert File.exist?(File.join(Gem.user_dir, 'gems'))
+ assert File.exist?(File.join(Gem.user_dir, 'gems',
@spec.full_name))
end
View
@@ -687,12 +687,9 @@ def test_install_user_local_fallback
@installer.install
end
- assert File.exist?(File.join(@userhome, '.gem', Gem.ruby_engine,
- Gem::ConfigMap[:ruby_version],
- 'gems', @spec.full_name, 'lib', 'code.rb'))
- assert File.exist?(File.join(@userhome, '.gem', Gem.ruby_engine,
- Gem::ConfigMap[:ruby_version],
- 'bin', 'executable'))
+ assert File.exist?(File.join(Gem.user_dir, 'gems',
+ @spec.full_name, 'lib', 'code.rb'))
+ assert File.exist?(File.join(Gem.user_dir, 'bin', 'executable'))
ensure
File.chmod 0755, Gem.dir
File.chmod 0755, util_inst_bindir
@@ -709,9 +706,7 @@ def test_install_bindir_read_only
@installer.install
end
- assert File.exist?(File.join(@userhome, '.gem', Gem.ruby_engine,
- Gem::ConfigMap[:ruby_version],
- 'bin', 'executable'))
+ assert File.exist?(File.join(Gem.user_dir, 'bin', 'executable'))
ensure
File.chmod 0755, util_inst_bindir
end
@@ -275,8 +275,7 @@ def test_download_read_only
fetcher = util_fuck_with_fetcher File.read(@a1_gem)
fetcher.download(@a1, 'http://gems.example.com')
- assert File.exist?(File.join(@userhome, '.gem', Gem.ruby_engine,
- Gem::ConfigMap[:ruby_version], 'cache',
+ assert File.exist?(File.join(Gem.user_dir, 'cache',
"#{@a1.full_name}.gem"))
ensure
File.chmod 0755, File.join(@gemhome)

0 comments on commit 8e701b5

Please sign in to comment.