From 9fbb73b5f53d45b233b0c8f9ee5482cb7ef5e9c9 Mon Sep 17 00:00:00 2001 From: Matt Brictson Date: Sat, 13 Jun 2020 20:44:32 -0700 Subject: [PATCH] Fix Bundler deprecation warning in `rake features` (#2063) This fixes the following warning when running `rake features` using the latest version of Bundler (2.1.4): ``` [DEPRECATED] `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` (called at spec/support/test_app.rb:194) ``` --- spec/support/test_app.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/support/test_app.rb b/spec/support/test_app.rb index 8d0eabcd..6ff6a7ce 100644 --- a/spec/support/test_app.rb +++ b/spec/support/test_app.rb @@ -191,6 +191,11 @@ module TestApp def with_clean_bundler_env(&block) return yield unless defined?(Bundler) - Bundler.with_clean_env(&block) + + if Bundler.respond_to?(:with_unbundled_env) + Bundler.with_unbundled_env(&block) + else + Bundler.with_clean_env(&block) + end end end