diff options
Diffstat (limited to 'ruby/spec/lib/gitlab/config_spec.rb')
-rw-r--r-- | ruby/spec/lib/gitlab/config_spec.rb | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/ruby/spec/lib/gitlab/config_spec.rb b/ruby/spec/lib/gitlab/config_spec.rb index 7652ba278..46321f3ea 100644 --- a/ruby/spec/lib/gitlab/config_spec.rb +++ b/ruby/spec/lib/gitlab/config_spec.rb @@ -1,6 +1,28 @@ require 'spec_helper' describe Gitlab::Config do + describe 'Logging' do + subject { described_class::Logging.new } + + describe '#dir' do + context 'when GITALY_LOG_DIR is set' do + it 'uses the setting' do + allow(ENV).to receive(:[]).with('GITALY_LOG_DIR').and_return('/path/to/logs') + + expect(subject.dir).to eq('/path/to/logs') + end + end + + context 'when GITALY_LOG_DIR is blank' do + it 'uses a default directory' do + allow(ENV).to receive(:[]).with('GITALY_LOG_DIR').and_return('') + + expect(subject.dir).not_to eq('') + end + end + end + end + describe '#gitlab_shell' do subject { described_class.new.gitlab_shell } @@ -12,7 +34,7 @@ describe Gitlab::Config do allow(ENV).to receive(:[]).with('GITLAB_SHELL_DIR').and_return(nil) end - it { expect(subject.path).to eq(gitlab_shell_path) } + specify { expect(subject.path).to eq(gitlab_shell_path) } end context 'when GITLAB_SHELL_DIR is set' do @@ -21,7 +43,7 @@ describe Gitlab::Config do allow(ENV).to receive(:[]).with('GITLAB_SHELL_DIR').and_return(gitlab_shell_path) end - it { expect(subject.path).to eq(gitlab_shell_path) } + specify { expect(subject.path).to eq(gitlab_shell_path) } end end end |