summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-01 12:36:22 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-12 10:15:43 +0100
commite49c588a33eb391b0c5f098ec2cf1352954015ec (patch)
tree7823a3f5f96cf58a27ff9f3c1883c2b628da4238
parentf05c1621913301451e2b4b3ea88c274e772c356e (diff)
downloadbundler-e49c588a33eb391b0c5f098ec2cf1352954015ec.tar.gz
Delay git sources removal to bundler 3 (for now)
This allows us to get most of the DSL related deprecation specs passing.
-rw-r--r--lib/bundler/feature_flag.rb2
-rw-r--r--spec/bundler/dsl_spec.rb4
-rw-r--r--spec/other/major_deprecation_spec.rb14
3 files changed, 14 insertions, 6 deletions
diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb
index e98ed8dabf..48eec1cca6 100644
--- a/lib/bundler/feature_flag.rb
+++ b/lib/bundler/feature_flag.rb
@@ -50,7 +50,7 @@ module Bundler
settings_flag(:prefer_gems_rb) { bundler_2_mode? }
settings_flag(:print_only_version_number) { bundler_2_mode? }
settings_flag(:setup_makes_kernel_gem_public) { !bundler_2_mode? }
- settings_flag(:skip_default_git_sources) { bundler_2_mode? }
+ settings_flag(:skip_default_git_sources) { bundler_3_mode? }
settings_flag(:specific_platform) { bundler_2_mode? }
settings_flag(:suppress_install_using_messages) { bundler_2_mode? }
settings_flag(:unlock_source_unlocks_spec) { !bundler_2_mode? }
diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb
index 19a5d6bcd1..c4cf72b53e 100644
--- a/spec/bundler/dsl_spec.rb
+++ b/spec/bundler/dsl_spec.rb
@@ -79,7 +79,7 @@ RSpec.describe Bundler::Dsl do
end
end
- context "default git sources", :bundler => "2" do
+ context "default git sources", :bundler => "3" do
it "has none" do
expect(subject.instance_variable_get(:@git_sources)).to eq({})
end
@@ -258,7 +258,7 @@ RSpec.describe Bundler::Dsl do
end
end
- describe "#github", :bundler => "2" do
+ describe "#github", :bundler => "3" do
it "from github" do
expect do
spree_gems = %w[spree_core spree_api spree_backend]
diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb
index be79ee2db9..d53f840a38 100644
--- a/spec/other/major_deprecation_spec.rb
+++ b/spec/other/major_deprecation_spec.rb
@@ -169,7 +169,7 @@ RSpec.describe "major deprecations" do
end
end
- xdescribe Bundler::Dsl do
+ describe Bundler::Dsl do
let(:msg) do
<<-EOS
The :github git source is deprecated, and will be removed in Bundler 2.0. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work:
@@ -185,12 +185,20 @@ The :github git source is deprecated, and will be removed in Bundler 2.0. Change
end
context "with github gems" do
- it "warns about the https change" do
+ xit "warns about the https change" do
+ expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, "The `github.https` setting will be removed")
+ subject.gem("sparks", :github => "indirect/sparks")
+ end
+
+ it "upgrades to https by default", :bundler => "2" do
expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, msg)
+ expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, "The `github.https` setting will be removed")
subject.gem("sparks", :github => "indirect/sparks")
+ github_uri = "https://github.com/indirect/sparks.git"
+ expect(subject.dependencies.first.source.uri).to eq(github_uri)
end
- it "upgrades to https on request" do
+ it "upgrades to https on request", :bundler => "< 2" do
Bundler.settings.temporary "github.https" => true
expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, msg)
expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, "The `github.https` setting will be removed")