summaryrefslogtreecommitdiff
path: root/spec/fast_spec_helper.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-04-10 16:07:47 +0200
committerRémy Coutable <remy@rymai.me>2018-04-23 12:20:30 +0200
commitc286c66f57e4fd716fe1746363f8c7cf4205cee3 (patch)
treefb2b9bc7c1c157bd1ca76051ce4c3c831e8d4b33 /spec/fast_spec_helper.rb
parentfe919f95b140f95ffcefc6f7fbfd0e7b1da43016 (diff)
downloadgitlab-ce-c286c66f57e4fd716fe1746363f8c7cf4205cee3.tar.gz
Move Settings to its own file, isolate it from Rails and introduce Gitlab.root
Signed-off-by: Rémy Coutable <remy@rymai.me>
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 32eb8db0fa5..b3fe76fb150 100644
--- a/spec/fast_spec_helper.rb
+++ b/spec/fast_spec_helper.rb
@@ -2,8 +2,9 @@ require 'bundler/setup'
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
@@ -11,27 +12,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