summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2018-12-18 11:56:44 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2018-12-19 10:26:44 +0100
commit10e5961028cf63bdc6aaf10dee9ac7cdda81e25e (patch)
tree94fa81f2f62e9c935f520bf6e7978f9b87aa2dad
parentff90b25fb646a23a7e468cabba805db77c635e10 (diff)
downloadbundler-10e5961028cf63bdc6aaf10dee9ac7cdda81e25e.tar.gz
Test deprecation message
-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 8ec21021e9..5eb2dd55b5 100644
--- a/spec/runtime/with_unbundled_env_spec.rb
+++ b/spec/runtime/with_unbundled_env_spec.rb
@@ -106,6 +106,24 @@ RSpec.describe "Bundler.with_env helpers" do
let(:modified_env) { "Bundler.clean_env" }
it_behaves_like "an unbundling helper"
+
+ it "prints a deprecation", :bundler => 2 do
+ code = "Bundler.clean_env"
+ bundle_exec_ruby! code.dump
+ expect(last_command.stdboth).to include(
+ "[DEPRECATED FOR 2.0] `Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \
+ "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`"
+ )
+ end
+
+ it "does not print a deprecation", :bundler => "< 2" do
+ code = "Bundler.clean_env"
+ bundle_exec_ruby! code.dump
+ expect(last_command.stdboth).not_to include(
+ "[DEPRECATED FOR 2.0] `Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \
+ "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`"
+ )
+ end
end
describe "Bundler.with_original_env" do