summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Walker <bwalker@gitlab.com>2018-01-05 14:42:16 +0100
committerBrett Walker <bwalker@gitlab.com>2018-01-22 17:25:10 +0100
commitc4687440c05a476cd343a14166dc93057ea34eb5 (patch)
treee6eb5cb2eef9e2bf69a2f89eb2fcad43e1653574
parente4a94fab6297b5f19bc4d15f55c5d38f41df35f2 (diff)
downloadgitlab-ce-c4687440c05a476cd343a14166dc93057ea34eb5.tar.gz
added specs for QA::Runtime::Env
-rw-r--r--qa/qa/runtime/env.rb2
-rw-r--r--qa/spec/runtime/env_spec.rb5
2 files changed, 2 insertions, 5 deletions
diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb
index afc5bd0f6ef..d5c28e9a7db 100644
--- a/qa/qa/runtime/env.rb
+++ b/qa/qa/runtime/env.rb
@@ -4,7 +4,7 @@ module QA
extend self
def chrome_headless?
- ENV['CHROME_HEADLESS'] =~ /^(false|no|0)$/i
+ (ENV['CHROME_HEADLESS'] =~ /^(false|no|0)$/i) != 0
end
def running_in_ci?
diff --git a/qa/spec/runtime/env_spec.rb b/qa/spec/runtime/env_spec.rb
index 57a72a04507..e8da51ddce7 100644
--- a/qa/spec/runtime/env_spec.rb
+++ b/qa/spec/runtime/env_spec.rb
@@ -1,8 +1,4 @@
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
@@ -59,6 +55,7 @@ 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