aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_spec_fetcher.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_spec_fetcher.rb')
-rw-r--r--test/rubygems/test_gem_spec_fetcher.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_spec_fetcher.rb b/test/rubygems/test_gem_spec_fetcher.rb
index 8be10a30b9..9e9a8e4d69 100644
--- a/test/rubygems/test_gem_spec_fetcher.rb
+++ b/test/rubygems/test_gem_spec_fetcher.rb
@@ -52,6 +52,24 @@ class TestGemSpecFetcher < Gem::TestCase
['x', Gem::Version.new(1), 'ruby']]
end
+ def test_initialize_unwritable_home_dir
+ FileUtils.rmdir Gem.user_home
+
+ assert Gem::SpecFetcher.new
+ end
+
+ def test_initialize_unwritable_home_dir
+ skip 'chmod not supported' if Gem.win_platform?
+
+ FileUtils.chmod 0000, Gem.user_home
+
+ begin
+ assert Gem::SpecFetcher.new
+ ensure
+ FileUtils.chmod 0755, Gem.user_home
+ end
+ end
+
def test_spec_for_dependency_all
d = "#{@gem_repo}#{Gem::MARSHAL_SPEC_DIR}"
@fetcher.data["#{d}#{@a1.spec_name}.rz"] = util_zip(Marshal.dump(@a1))