From 94aea34a9df3f50fdafceee500bd8080fe9fc55d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Thu, 28 Mar 2019 17:36:28 +0100 Subject: Add `clean_{exec,system}` deprecation specs --- spec/other/major_deprecation_spec.rb | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb index f2c28e6f6b..39bba9c3da 100644 --- a/spec/other/major_deprecation_spec.rb +++ b/spec/other/major_deprecation_spec.rb @@ -48,6 +48,42 @@ RSpec.describe "major deprecations" do end end + describe ".clean_system" do + before do + source = "Bundler.clean_system('ls')" + bundle "exec ruby -e #{source.dump}" + end + + it "is not deprecated", :bundler => "< 2" do + expect(deprecations).to be_empty + end + + it "is deprecated in favor of .unbundled_system", :bundler => "2" do + expect(deprecations).to include( + "`Bundler.clean_system` has been deprecated in favor of `Bundler.unbundled_system`. " \ + "If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system`" + ) + end + end + + describe ".clean_exec" do + before do + source = "Bundler.clean_exec('ls')" + bundle "exec ruby -e #{source.dump}" + end + + it "is not deprecated", :bundler => "< 2" do + expect(deprecations).to be_empty + end + + it "is deprecated in favor of .unbundled_exec", :bundler => "2" do + expect(deprecations).to include( + "`Bundler.clean_exec` has been deprecated in favor of `Bundler.unbundled_exec`. " \ + "If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec`" + ) + end + end + describe ".environment" do before do source = "Bundler.environment" -- cgit v1.2.1