From 2bd8eda4acba634f6a6ff44eadfe3578741f2a1c Mon Sep 17 00:00:00 2001 From: Brett Walker Date: Fri, 5 Jan 2018 15:43:47 +0100 Subject: since we're setting to ENV values... move the `allow(ENV).to receive(:[]).and_call_original` to the front so the seconda call doesn't override the first --- qa/spec/runtime/env_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qa/spec/runtime/env_spec.rb b/qa/spec/runtime/env_spec.rb index e8da51ddce7..57a72a04507 100644 --- a/qa/spec/runtime/env_spec.rb +++ b/qa/spec/runtime/env_spec.rb @@ -1,4 +1,8 @@ describe QA::Runtime::Env do + before do + allow(ENV).to receive(:[]).and_call_original + end + describe '.chrome_headless?' do context 'when there is an env variable set' do it 'returns false when falsey values specified' do @@ -55,7 +59,6 @@ describe QA::Runtime::Env do end def stub_env(name, value) - allow(ENV).to receive(:[]).and_call_original allow(ENV).to receive(:[]).with(name).and_return(value) end end -- cgit v1.2.1