Commit 82778305 authored by Rémy Coutable's avatar Rémy Coutable

Abort when `TestEnv.init` is not called in the `test` environment

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 3e5477b3
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment