diff options
-rw-r--r-- | lib/gitlab_init.rb | 2 | ||||
-rw-r--r-- | spec/spec_helper.rb | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/gitlab_init.rb b/lib/gitlab_init.rb index c3f35a2..2767a62 100644 --- a/lib/gitlab_init.rb +++ b/lib/gitlab_init.rb @@ -1,3 +1,3 @@ -ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__), "..")) +ROOT_PATH = File.expand_path('..', __dir__) require_relative 'gitlab_config' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d93f88d..7b7b1b7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,3 @@ -ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__), "..")) - require 'simplecov' SimpleCov.start @@ -13,6 +11,12 @@ VCR.configure do |c| c.configure_rspec_metadata! end +RSpec.configure do |config| + config.before(:each) do + stub_const('ROOT_PATH', File.expand_path('..', __dir__)) + end +end + # like WEBrick::HTTPServer, but listens on UNIX socket class HTTPUNIXServer < WEBrick::HTTPServer def listen(address, port) |