summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/install/gems/sudo_spec.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/install/gems/sudo_spec.rb b/spec/install/gems/sudo_spec.rb
index 59612e017d..f0e8435edc 100644
--- a/spec/install/gems/sudo_spec.rb
+++ b/spec/install/gems/sudo_spec.rb
@@ -53,7 +53,6 @@ describe "when using sudo", :sudo => true 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}"
ENV['BUNDLE_PATH'] = bundle_path.to_s
install_gemfile <<-G
@@ -61,8 +60,10 @@ describe "when using sudo", :sudo => true do
gem "rack", '1.0'
G
- expect(bundle_path.join("gems/rack-1.0.0")).to exist
- expect(bundle_path.join("gems/rack-1.0.0").stat.uid).to eq(0)
+ sudo "chown -R root #{bundle_path}"
+
+ expect(bundle_path.join("#{Bundler.ruby_scope}/gems/rack-1.0.0")).to exist
+ expect(bundle_path.join("#{Bundler.ruby_scope}/gems/rack-1.0.0").stat.uid).to eq(0)
should_be_installed "rack 1.0"
end
@@ -77,9 +78,10 @@ describe "when using sudo", :sudo => true do
source "file://#{gem_repo1}"
gem "rack", '1.0'
G
+ sudo "chown -R root #{bundle_path}"
- expect(bundle_path.join("gems/rack-1.0.0")).to exist
- expect(bundle_path.join("gems/rack-1.0.0").stat.uid).to eq(0)
+ expect(bundle_path.join("#{Bundler.ruby_scope}/gems/rack-1.0.0")).to exist
+ expect(bundle_path.join("#{Bundler.ruby_scope}/gems/rack-1.0.0").stat.uid).to eq(0)
should_be_installed "rack 1.0"
end