diff options
Diffstat (limited to 'spec/other/major_deprecation_spec.rb')
-rw-r--r-- | spec/other/major_deprecation_spec.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb index 5175e8d4c8..5aca219974 100644 --- a/spec/other/major_deprecation_spec.rb +++ b/spec/other/major_deprecation_spec.rb @@ -121,6 +121,42 @@ RSpec.describe "major deprecations" do "flags passed to commands will no longer be automatically remembered." ) end + + { + :clean => true, + :deployment => true, + :frozen => true, + :"no-cache" => true, + :"no-prune" => true, + :path => "vendor/bundle", + :shebang => "ruby27", + :system => true, + :without => "development", + :with => "development", + }.each do |name, value| + flag_name = "--#{name}" + + context "with the #{flag_name} flag", :bundler => "2" do + it "should print a deprecation warning" do + bundle "install #{flag_name} #{value}" + + expect(warnings).to have_major_deprecation( + "The `#{flag_name}` flag is deprecated because it relied on " \ + "being remembered accross bundler invokations, which bundler " \ + "will no longer do in future versions. Instead please use " \ + "`bundle config #{name} '#{value}'`, and stop using this flag" + ) + end + end + + context "with the #{flag_name} flag", :bundler => "< 2" do + it "should not print a deprecation warning" do + bundle "install #{flag_name} #{value}" + + expect(warnings).not_to have_major_deprecation + end + end + end end end |