summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2018-12-18 12:26:26 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2018-12-19 10:26:46 +0100
commit4f59cc6524016a529aecf0eca5c17fca16e1f311 (patch)
treeb00096dea49ace0d3eed44c004acfb76fa03e886
parentea6e91bc9e5c0ad2ad3d6b5cdd58bb3e7777d07e (diff)
downloadbundler-clean_env_deprecation_path.tar.gz
Test `with_clean_env` deprecationsclean_env_deprecation_path
-rw-r--r--spec/runtime/with_unbundled_env_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/runtime/with_unbundled_env_spec.rb b/spec/runtime/with_unbundled_env_spec.rb
index 2c3cc1dbaa..83eb1eac13 100644
--- a/spec/runtime/with_unbundled_env_spec.rb
+++ b/spec/runtime/with_unbundled_env_spec.rb
@@ -156,6 +156,24 @@ RSpec.describe "Bundler.with_env helpers" do
expect(ENV).not_to have_key("FOO")
end
+
+ it "prints a deprecation", :bundler => 2 do
+ code = "Bundler.with_clean_env {}"
+ bundle_exec_ruby! code.dump
+ expect(last_command.stdboth).to include(
+ "[DEPRECATED FOR 2.0] `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
+
+ it "does not print a deprecation", :bundler => "< 2" do
+ code = "Bundler.with_clean_env {}"
+ bundle_exec_ruby! code.dump
+ expect(last_command.stdboth).not_to include(
+ "[DEPRECATED FOR 2.0] `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 "Bundler.with_unbundled_env" do