From 26d3a59f61b72d44973f14630c2d889b4ca00a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 24 Apr 2019 11:23:58 +0200 Subject: Fully switch to https sources --- spec/other/major_deprecation_spec.rb | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'spec/other') diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb index 83944e4075..53bc4b0b79 100644 --- a/spec/other/major_deprecation_spec.rb +++ b/spec/other/major_deprecation_spec.rb @@ -365,38 +365,30 @@ RSpec.describe "major deprecations" do end describe Bundler::Dsl do - let(:msg) do - <<-EOS -The :github git source is deprecated, and will be removed in the future. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work: - - git_source(:github) {|repo_name| "https://github.com/\#{repo_name}.git" } - - EOS - end - before do @rubygems = double("rubygems") allow(Bundler::Source::Rubygems).to receive(:new) { @rubygems } end context "with github gems" do - it "warns about the https change if people are opting out" do - Bundler.settings.temporary "github.https" => false - expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg) - expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, "Setting `github.https` to false is deprecated and won't be supported in the future.") - subject.gem("sparks", :github => "indirect/sparks") - end + it "warns about removal", :bundler => "2" do + msg = <<-EOS +The :github git source is deprecated, and will be removed in the future. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work: + + git_source(:github) {|repo_name| "https://github.com/\#{repo_name}.git" } - it "upgrades to https by default", :bundler => "2" do + EOS expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg) 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 + + pending "should fail with a helpful error", :bundler => "3" end context "with bitbucket gems" do - it "warns about removal" do + it "warns about removal", :bundler => "2" do allow(Bundler.ui).to receive(:deprecate) msg = <<-EOS The :bitbucket git source is deprecated, and will be removed in the future. Add this code to the top of your Gemfile to ensure it continues to work: @@ -411,10 +403,12 @@ The :bitbucket git source is deprecated, and will be removed in the future. Add expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg) subject.gem("not-really-a-gem", :bitbucket => "mcorp/flatlab-rails") end + + pending "should fail with a helpful error", :bundler => "3" end context "with gist gems" do - it "warns about removal" do + it "warns about removal", :bundler => "2" do allow(Bundler.ui).to receive(:deprecate) msg = <<-EOS The :gist git source is deprecated, and will be removed in the future. Add this code to the top of your Gemfile to ensure it continues to work: @@ -425,6 +419,8 @@ The :gist git source is deprecated, and will be removed in the future. Add this expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg) subject.gem("not-really-a-gem", :gist => "1234") end + + pending "should fail with a helpful error", :bundler => "3" end end -- cgit v1.2.1