summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-12-23 21:52:29 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-12-31 14:24:16 +0100
commit4a70beb76568e9a51c78ed64ed5e59f9b381a9f9 (patch)
tree42d155ee0af4cfa057eeaba760dd221ff806ce68
parent00ab157c8581b2b0775a016292e11e9025c507cc (diff)
downloadbundler-4a70beb76568e9a51c78ed64ed5e59f9b381a9f9.tar.gz
Split credentials specs out of the surrounding context
So that I can change the setup only for them in following commits.
-rw-r--r--spec/install/deploy_spec.rb141
1 files changed, 71 insertions, 70 deletions
diff --git a/spec/install/deploy_spec.rb b/spec/install/deploy_spec.rb
index 612533d539..ee456b2301 100644
--- a/spec/install/deploy_spec.rb
+++ b/spec/install/deploy_spec.rb
@@ -104,6 +104,77 @@ RSpec.describe "install with --deployment or --frozen" do
expect(the_bundle).to include_gems "rack 1.0"
end
+ context "when replacing a host with the same host with credentials" do
+ before do
+ bundle! "install"
+ gemfile <<-G
+ source "http://user_name:password@localgemserver.test/"
+ gem "rack"
+ G
+
+ lockfile <<-G
+ GEM
+ remote: http://localgemserver.test/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{local}
+
+ DEPENDENCIES
+ rack
+ G
+
+ bundle! "config set --local deployment true"
+ end
+
+ it "prevents the replace by default" do
+ bundle :install
+
+ expect(err).to match(/The list of sources changed/)
+ end
+
+ context "when allow_deployment_source_credential_changes is true" do
+ before { bundle! "config set allow_deployment_source_credential_changes true" }
+
+ it "allows the replace" do
+ bundle! :install
+
+ expect(out).to match(/Bundle complete!/)
+ end
+ end
+
+ context "when allow_deployment_source_credential_changes is false" do
+ before { bundle! "config set allow_deployment_source_credential_changes false" }
+
+ it "prevents the replace" do
+ bundle :install
+
+ expect(err).to match(/The list of sources changed/)
+ end
+ end
+
+ context "when BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES env var is true" do
+ before { ENV["BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES"] = "true" }
+
+ it "allows the replace" do
+ bundle :install
+
+ expect(out).to match(/Bundle complete!/)
+ end
+ end
+
+ context "when BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES env var is false" do
+ before { ENV["BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES"] = "false" }
+
+ it "prevents the replace" do
+ bundle :install
+
+ expect(err).to match(/The list of sources changed/)
+ end
+ end
+ end
+
describe "with an existing lockfile" do
before do
bundle! "install"
@@ -280,76 +351,6 @@ RSpec.describe "install with --deployment or --frozen" do
expect(err).not_to include("You have deleted from the Gemfile")
end
- context "when replacing a host with the same host with credentials" do
- before do
- gemfile <<-G
- source "http://user_name:password@localgemserver.test/"
- gem "rack"
- G
-
- lockfile <<-G
- GEM
- remote: http://localgemserver.test/
- specs:
- rack (1.0.0)
-
- PLATFORMS
- #{local}
-
- DEPENDENCIES
- rack
- G
-
- bundle! "config set --local deployment true"
- end
-
- it "prevents the replace by default" do
- bundle :install
-
- expect(err).to match(/The list of sources changed/)
- end
-
- context "when allow_deployment_source_credential_changes is true" do
- before { bundle! "config set allow_deployment_source_credential_changes true" }
-
- it "allows the replace" do
- bundle! :install
-
- expect(out).to match(/Bundle complete!/)
- end
- end
-
- context "when allow_deployment_source_credential_changes is false" do
- before { bundle! "config set allow_deployment_source_credential_changes false" }
-
- it "prevents the replace" do
- bundle :install
-
- expect(err).to match(/The list of sources changed/)
- end
- end
-
- context "when BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES env var is true" do
- before { ENV["BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES"] = "true" }
-
- it "allows the replace" do
- bundle :install
-
- expect(out).to match(/Bundle complete!/)
- end
- end
-
- context "when BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES env var is false" do
- before { ENV["BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES"] = "false" }
-
- it "prevents the replace" do
- bundle :install
-
- expect(err).to match(/The list of sources changed/)
- end
- end
- end
-
it "remembers that the bundle is frozen at runtime" do
bundle! :lock