diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2018-12-18 10:40:42 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2018-12-19 10:26:43 +0100 |
commit | 24a40c6c8256db3372fcc7894e10dc7384e36851 (patch) | |
tree | 4e33419ec26a76522747e1a3815d141de94b666d | |
parent | 25cf7000f3ea9f88de1bdc848e6237be384df7bc (diff) | |
download | bundler-24a40c6c8256db3372fcc7894e10dc7384e36851.tar.gz |
Extract test subject to a let
To convert this into a shared spec more easily.
-rw-r--r-- | spec/runtime/with_unbundled_env_spec.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/runtime/with_unbundled_env_spec.rb b/spec/runtime/with_unbundled_env_spec.rb index ecccb1b0bb..9900429da5 100644 --- a/spec/runtime/with_unbundled_env_spec.rb +++ b/spec/runtime/with_unbundled_env_spec.rb @@ -66,6 +66,8 @@ RSpec.describe "Bundler.with_env helpers" do end describe "Bundler.unbundled_env" do + let(:modified_env) { "Bundler.unbundled_env" } + before do bundle "config path vendor/bundle" gemfile "" @@ -73,28 +75,28 @@ RSpec.describe "Bundler.with_env helpers" do end it "should delete BUNDLE_PATH" do - code = "print Bundler.unbundled_env.has_key?('BUNDLE_PATH')" + code = "print #{modified_env}.has_key?('BUNDLE_PATH')" ENV["BUNDLE_PATH"] = "./foo" bundle_exec_ruby! code.dump expect(last_command.stdboth).to eq "false" end it "should remove '-rbundler/setup' from RUBYOPT" do - code = "print Bundler.unbundled_env['RUBYOPT']" + code = "print #{modified_env}['RUBYOPT']" ENV["RUBYOPT"] = "-W2 -rbundler/setup" bundle_exec_ruby! code.dump expect(last_command.stdboth).not_to include("-rbundler/setup") end it "should clean up RUBYLIB", :ruby_repo do - code = "print Bundler.unbundled_env['RUBYLIB']" + code = "print #{modified_env}['RUBYLIB']" ENV["RUBYLIB"] = root.join("lib").to_s + File::PATH_SEPARATOR + "/foo" bundle_exec_ruby! code.dump expect(last_command.stdboth).to eq("/foo") end it "should restore the original MANPATH" do - code = "print Bundler.unbundled_env['MANPATH']" + code = "print #{modified_env}['MANPATH']" ENV["MANPATH"] = "/foo" ENV["BUNDLER_ORIG_MANPATH"] = "/foo-original" bundle_exec_ruby! code.dump |