diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-03-28 17:28:08 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-03-30 10:50:11 +0100 |
commit | 3df21cc3e46bbdacfaf09299c8d47856f0067307 (patch) | |
tree | 86d97ea2c311ed65627f320279e70294249af558 | |
parent | 52e329f4385b73923a343e413cd36f7323448e6d (diff) | |
download | bundler-3df21cc3e46bbdacfaf09299c8d47856f0067307.tar.gz |
Merge "clean" helper deprecations to single place
-rw-r--r-- | spec/other/major_deprecation_spec.rb | 18 | ||||
-rw-r--r-- | spec/runtime/with_unbundled_env_spec.rb | 36 |
2 files changed, 18 insertions, 36 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" diff --git a/spec/runtime/with_unbundled_env_spec.rb b/spec/runtime/with_unbundled_env_spec.rb index 1ed853f467..24a08992b2 100644 --- a/spec/runtime/with_unbundled_env_spec.rb +++ b/spec/runtime/with_unbundled_env_spec.rb @@ -102,24 +102,6 @@ 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(err).to include( - "[DEPRECATED] `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(out).not_to include( - "[DEPRECATED] `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 @@ -152,24 +134,6 @@ 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(err).to include( - "[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`" - ) - end - - it "does not print a deprecation", :bundler => "< 2" do - code = "Bundler.with_clean_env {}" - bundle_exec_ruby! code.dump - expect(out).not_to include( - "[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`" - ) - end end describe "Bundler.with_unbundled_env" do |