summaryrefslogtreecommitdiff
path: root/spec/commands/install_spec.rb
diff options
context:
space:
mode:
authorJames Wen <jrw2175@columbia.edu>2016-02-16 22:24:53 -0500
committerJames Wen <jrw2175@columbia.edu>2016-02-16 23:03:44 -0500
commit0611c4bea9a5da42f668af64ae31d7628c640c5e (patch)
tree5fa0dbefdba57642e0342f15f22742b664b8190d /spec/commands/install_spec.rb
parent73e23068114da3cbb110a9a8c1aed4cd03b1a0f8 (diff)
downloadbundler-0611c4bea9a5da42f668af64ae31d7628c640c5e.tar.gz
Add helpful message and error handling for non-CGI-escaped authentication
- Closes #4288
Diffstat (limited to 'spec/commands/install_spec.rb')
-rw-r--r--spec/commands/install_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb
index 9c81457068..e48d5009ae 100644
--- a/spec/commands/install_spec.rb
+++ b/spec/commands/install_spec.rb
@@ -459,4 +459,20 @@ describe "bundle install with gem sources" do
expect(out).to include("grant write permissions")
end
end
+
+ describe "when bundle install is executed with unencoded authentication" do
+ before do
+ gemfile <<-G
+ source 'https://rubygems.org/'
+ gem 'bundler'
+ G
+ end
+
+ it "should display a helpful messag explaining how to fix it" do
+ bundle :install, :env => { "BUNDLE_RUBYGEMS__ORG" => "user:pass{word" }
+ expect(exitstatus).to eq(17) if exitstatus
+ expect(out).to eq("Please CGI escape your usernames and passwords before " \
+ "setting them for authentication.")
+ end
+ end
end