From 7e3bd288294e05eec7a53b6f86bf17fef9364125 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Wed, 17 Aug 2016 23:07:23 -0500 Subject: [SharedHelpers] Always print major deprecations on .99 versions --- lib/bundler/shared_helpers.rb | 3 ++- spec/other/major_deprecation_spec.rb | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index 69543356a2..ca4eafd623 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -224,7 +224,8 @@ module Bundler def prints_major_deprecations? require "bundler" - return false unless Bundler.settings[:major_deprecations] + deprecation_release = Bundler::VERSION.split(".").drop(1).include?("99") + return false if !deprecation_release && !Bundler.settings[:major_deprecations] require "bundler/deprecate" return false if Bundler::Deprecate.skip true diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb index c8a2633279..6505023d13 100644 --- a/spec/other/major_deprecation_spec.rb +++ b/spec/other/major_deprecation_spec.rb @@ -4,6 +4,22 @@ require "spec_helper" describe "major deprecations" do let(:warnings) { out } # change to err in 2.0 + context "in a .99 version" do + before do + simulate_bundler_version "1.99.1" + bundle "config --delete major_deprecations" + end + + it "prints major deprecations without being configured" do + ruby <<-R + require "bundler" + Bundler::SharedHelpers.major_deprecation(Bundler::VERSION) + R + + expect(warnings).to have_major_deprecation("1.99.1") + end + end + before do bundle "config major_deprecations true" -- cgit v1.2.1