diff options
| author | Mike McQuaid | 2017-10-30 08:17:06 +0000 |
|---|---|---|
| committer | GitHub | 2017-10-30 08:17:06 +0000 |
| commit | 7a0fdc3d03e8ee97f49cb0e1f061271c6c492dd4 (patch) | |
| tree | 16f161a7435db7f90f3db04065ccdf4761ffb28f /Library/Homebrew/test | |
| parent | 4c44266aa5cfab215b92ef0aa5bb12112d8a4cb8 (diff) | |
| parent | ca189437e4d35f9e6c89f4b7955613f708ab3282 (diff) | |
| download | brew-7a0fdc3d03e8ee97f49cb0e1f061271c6c492dd4.tar.bz2 | |
Merge pull request #3393 from MikeMcQuaid/with_env_tweaks
Tweak use of with_env
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/utils_spec.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/test/utils_spec.rb b/Library/Homebrew/test/utils_spec.rb index 0c2ae5161..037a80b64 100644 --- a/Library/Homebrew/test/utils_spec.rb +++ b/Library/Homebrew/test/utils_spec.rb @@ -274,13 +274,13 @@ describe "globally-scoped helper methods" do describe "#with_env" do it "sets environment variables within the block" do expect(ENV["PATH"]).not_to eq("/bin") - with_env "PATH" => "/bin" do + with_env(PATH: "/bin") do expect(ENV["PATH"]).to eq("/bin") end end it "restores ENV after the block" do - with_env "PATH" => "/bin" do + with_env(PATH: "/bin") do expect(ENV["PATH"]).to eq("/bin") end expect(ENV["PATH"]).not_to eq("/bin") @@ -288,7 +288,7 @@ describe "globally-scoped helper methods" do it "restores ENV if an exception is raised" do expect { - with_env "PATH" => "/bin" do + with_env(PATH: "/bin") do raise StandardError, "boom" end }.to raise_error(StandardError) |
