summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Böning <rb@magiclabs.de>2015-09-27 13:25:26 +0300
committerAgis Anastasopoulos <agis.anast@gmail.com>2015-09-27 16:54:11 +0300
commite720571267f94d98ddfbbeaccfdda6129e9b7da6 (patch)
tree287a25d87c3a35fb7e5962f8259a286c9502378e
parente6e1ff5953e5713fbdd7c2664ed785b426bea827 (diff)
downloadbundler-e720571267f94d98ddfbbeaccfdda6129e9b7da6.tar.gz
Add test case for friendly permission errors
Cherry-picked from #4019.
-rw-r--r--spec/commands/install_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb
index f6648ac6b0..5132e4cffb 100644
--- a/spec/commands/install_spec.rb
+++ b/spec/commands/install_spec.rb
@@ -374,4 +374,22 @@ describe "bundle install with gem sources" do
expect(out).to_not include("Your Gemfile has no gem server sources")
end
end
+
+ describe "when bundle path does not have write access" do
+ before do
+ FileUtils.mkdir_p(bundled_app("vendor"))
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem 'rack'
+ G
+ end
+
+ it "should display a proper message to explain the problem" do
+ FileUtils.chmod(0500, bundled_app("vendor"))
+
+ bundle :install, :path => "vendor"
+ expect(out).to include(bundled_app("vendor").to_s)
+ expect(out).to include("grant write permissions")
+ end
+ end
end