diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-02-22 11:03:18 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-02-25 21:09:10 +0100 |
commit | 2f712047bcaf61f690fa1795a0057ba7850aae93 (patch) | |
tree | 1de20345829ab77feab2bedcd351256d0bb44f0f | |
parent | 7c8597c486c9efcd708e0314584f78e08fbc03ce (diff) | |
download | bundler-2f712047bcaf61f690fa1795a0057ba7850aae93.tar.gz |
Remove unnecessary old rubygems deprecation
-rw-r--r-- | lib/bundler/shared_helpers.rb | 10 | ||||
-rw-r--r-- | spec/other/major_deprecation_spec.rb | 23 |
2 files changed, 4 insertions, 29 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index db3f123bca..996f7b3fd4 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -159,13 +159,9 @@ module Bundler next if gemfiles.empty? break false if gemfiles.size == 1 end - if multiple_gemfiles && Bundler.bundler_major_version == 1 - Bundler::SharedHelpers.major_deprecation 2, \ - "gems.rb and gems.locked will be preferred to Gemfile and Gemfile.lock." - end - - return if Bundler.rubygems.provides?(">= 2") - major_deprecation(2, "Bundler will only support rubygems >= 2.0, you are running #{Bundler.rubygems.version}") + return unless multiple_gemfiles && Bundler.bundler_major_version == 1 + Bundler::SharedHelpers.major_deprecation 2, \ + "gems.rb and gems.locked will be preferred to Gemfile and Gemfile.lock." end def trap(signal, override = false, &block) diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb index 05b4301d4c..ef51112d72 100644 --- a/spec/other/major_deprecation_spec.rb +++ b/spec/other/major_deprecation_spec.rb @@ -2,7 +2,7 @@ RSpec.describe "major deprecations", :bundler => "< 2" do let(:warnings) { last_command.bundler_err } # change to err in 2.0 - let(:warnings_without_version_messages) { warnings.gsub(/#{Spec::Matchers::MAJOR_DEPRECATION}Bundler will only support ruby(gems)? >= .*/, "") } + let(:warnings_without_version_messages) { warnings.gsub(/#{Spec::Matchers::MAJOR_DEPRECATION}Bundler will only support ruby >= .*/, "") } before do create_file "gems.rb", <<-G @@ -32,27 +32,6 @@ RSpec.describe "major deprecations", :bundler => "< 2" do end end - shared_examples_for "environmental deprecations" do |trigger| - describe "rubygems version", :rubygems => "< 2.0" do - it "requires a newer rubygems version" do - instance_eval(&trigger) - expect(warnings).to have_major_deprecation "Bundler will only support rubygems >= 2.0, you are running #{Gem::VERSION}" - end - end - end - - describe "-rbundler/setup" do - it_behaves_like "environmental deprecations", proc { ruby "require 'bundler/setup'" } - end - - describe "Bundler.setup" do - it_behaves_like "environmental deprecations", proc { ruby "require 'bundler'; Bundler.setup" } - end - - describe "bundle check" do - it_behaves_like "environmental deprecations", proc { bundle :check } - end - describe "bundle update --quiet" do it "does not print any deprecations" do bundle :update, :quiet => true |