diff options
author | Andre Arko <andre@arko.net> | 2010-07-11 18:04:54 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2010-07-11 18:11:41 -0700 |
commit | e82aaf32fa2b2e7f5c21c898c520a71ebb1a64d6 (patch) | |
tree | d31efd9a689d39600574b0c7b2c7bd6f5c931a16 | |
parent | 05287ae8580ea2deb92a2ebb248de78fea89e382 (diff) | |
download | bundler-e82aaf32fa2b2e7f5c21c898c520a71ebb1a64d6.tar.gz |
Spec for unwritable BUNDLE_PATH
-rw-r--r-- | spec/install/gems/sudo_spec.rb | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/spec/install/gems/sudo_spec.rb b/spec/install/gems/sudo_spec.rb index b81ed69d9b..8a8ce48928 100644 --- a/spec/install/gems/sudo_spec.rb +++ b/spec/install/gems/sudo_spec.rb @@ -3,11 +3,14 @@ require "spec_helper" describe "when using sudo" do before :each do pending "set BUNDLER_SUDO_TESTS to run sudo specs" unless test_sudo? - chown_system_gems_to_root end - describe "bundle install with GEM_HOME owned by root" do - it "works" do + describe "and GEM_HOME is owned by root" do + before :each do + chown_system_gems_to_root + end + + it "installs" do install_gemfile <<-G source "file://#{gem_repo1}" gem "rack", '1.0' @@ -18,7 +21,7 @@ describe "when using sudo" do should_be_installed "rack 1.0" end - it "works when BUNDLE_PATH does not exist" do + it "installs when BUNDLE_PATH is owned by root" do bundle_path = tmp("owned_by_root") FileUtils.mkdir_p bundle_path sudo "chown -R root #{bundle_path}" @@ -33,5 +36,21 @@ describe "when using sudo" do bundle_path.join("gems/rack-1.0.0").stat.uid.should == 0 should_be_installed "rack 1.0" end + + it "installs when BUNDLE_PATH does not exist" end + + describe "and BUNDLE_PATH is not writable" do + it "installs" do + sudo "chmod ugo-w #{default_bundle_path}" + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "rack", '1.0' + G + + default_bundle_path("gems/rack-1.0.0").should exist + should_be_installed "rack 1.0" + end + end + end
\ No newline at end of file |