summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/other/major_deprecation_spec.rb36
1 files changed, 36 insertions, 0 deletions
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"