diff options
author | Rémy Coutable <remy@rymai.me> | 2017-09-14 17:23:10 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-09-14 17:23:10 +0200 |
commit | 827783054fc0281351f37bbea102703675b7048c (patch) | |
tree | 42dcf9e78bd05c87176c94093f4e05709f6dd75c | |
parent | 3e5477b3ab1838a75dc5461e4176b5631bf08412 (diff) | |
download | gitlab-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.rb | 5 |
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 |