From 827783054fc0281351f37bbea102703675b7048c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 14 Sep 2017 17:23:10 +0200 Subject: Abort when `TestEnv.init` is not called in the `test` environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- spec/support/test_env.rb | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit v1.2.1