summaryrefslogtreecommitdiff
path: root/spec/other/major_deprecation_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/other/major_deprecation_spec.rb')
-rw-r--r--spec/other/major_deprecation_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb
index f4d55a450c..f2c28e6f6b 100644
--- a/spec/other/major_deprecation_spec.rb
+++ b/spec/other/major_deprecation_spec.rb
@@ -30,6 +30,24 @@ RSpec.describe "major deprecations" do
end
end
+ describe ".with_clean_env" do
+ before do
+ source = "Bundler.with_clean_env {}"
+ 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_env", :bundler => "2" do
+ expect(deprecations).to include(
+ "`Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \
+ "If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`"
+ )
+ end
+ end
+
describe ".environment" do
before do
source = "Bundler.environment"