summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-09-14 17:23:10 +0200
committerRémy Coutable <remy@rymai.me>2017-09-14 17:23:10 +0200
commit827783054fc0281351f37bbea102703675b7048c (patch)
tree42dcf9e78bd05c87176c94093f4e05709f6dd75c
parent3e5477b3ab1838a75dc5461e4176b5631bf08412 (diff)
downloadgitlab-ce-827783054fc0281351f37bbea102703675b7048c.tar.gz
Abort when `TestEnv.init` is not called in the `test` environment
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--spec/support/test_env.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/support/test_env.rb b/spec/support/test_env.rb
index 71b9deeabc3..44540e39437 100644
--- a/spec/support/test_env.rb
+++ b/spec/support/test_env.rb
@@ -63,6 +63,11 @@ module TestEnv
# See gitlab.yml.example test section for paths
#
def init(opts = {})
+ unless Rails.env.test?
+ puts "\nTestEnv.init can only be run if `RAILS_ENV` is set to 'test' not '#{Rails.env}'!\n"
+ exit 1
+ end
+
# Disable mailer for spinach tests
disable_mailer if opts[:mailer] == false