summaryrefslogtreecommitdiff
path: root/spec/fast_spec_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/fast_spec_helper.rb')
-rw-r--r--spec/fast_spec_helper.rb27
1 files changed, 5 insertions, 22 deletions
diff --git a/spec/fast_spec_helper.rb b/spec/fast_spec_helper.rb
index bf9bed2ba59..d6d8a6cdbfd 100644
--- a/spec/fast_spec_helper.rb
+++ b/spec/fast_spec_helper.rb
@@ -3,8 +3,9 @@ require 'bundler/setup'
require 'active_support/string_inquirer'
require 'settingslogic'
-ENV["RAILS_ENV"] = 'test'
-ENV["IN_MEMORY_APPLICATION_SETTINGS"] = 'true'
+ENV['GITLAB_ENV'] = 'test'
+ENV['RAILS_ENV'] = 'test'
+ENV['IN_MEMORY_APPLICATION_SETTINGS'] = 'true'
unless Kernel.respond_to?(:require_dependency)
module Kernel
@@ -12,27 +13,9 @@ unless Kernel.respond_to?(:require_dependency)
end
end
-unless defined?(Rails)
- module Rails
- def self.root
- Pathname.new(File.expand_path(''))
- end
-
- # Copied from https://github.com/rails/rails/blob/v4.2.10/railties/lib/rails.rb#L59-L61
- def self.env
- @_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development")
- end
- end
-end
-
-# Settings is used in config/initializers/2_app.rb
-class Settings < Settingslogic
- source Rails.root.join('config/gitlab.yml')
- namespace Rails.env
-end
-
-# Defines Gitlab and Gitlab.config
+# Defines Gitlab and Gitlab.config which are at the center of the app
unless defined?(Gitlab) && Gitlab.respond_to?(:config)
+ require_relative '../lib/settings'
require_relative '../config/initializers/2_app'
end