diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2018-08-15 11:54:31 +1000 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2018-08-17 14:17:24 +1000 |
commit | f65211c74ce17d233f5bba8d95107766867e4ae5 (patch) | |
tree | caa75916a3270c7d7b457d6874ac819841a4224e | |
parent | fb8606f65a60808e52539f71f09fba871b5aba6b (diff) | |
download | gitlab-shell-f65211c74ce17d233f5bba8d95107766867e4ae5.tar.gz |
Fix broken GitlabConfig spec
Spec was relying upon actual config.yml
-rw-r--r-- | spec/gitlab_config_spec.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/spec/gitlab_config_spec.rb b/spec/gitlab_config_spec.rb index c262116..d12b657 100644 --- a/spec/gitlab_config_spec.rb +++ b/spec/gitlab_config_spec.rb @@ -3,29 +3,34 @@ require_relative '../lib/gitlab_config' describe GitlabConfig do let(:config) { GitlabConfig.new } + let(:config_data) { {} } - describe :gitlab_url do + before { expect(YAML).to receive(:load_file).and_return(config_data) } + + describe '#gitlab_url' do let(:url) { 'http://test.com' } + subject { config.gitlab_url } - before { config.send(:config)['gitlab_url'] = url } + + before { config_data['gitlab_url'] = url } it { is_expected.not_to be_empty } it { is_expected.to eq(url) } context 'remove trailing slashes' do - before { config.send(:config)['gitlab_url'] = url + '//' } + before { config_data['gitlab_url'] = url + '//' } it { is_expected.to eq(url) } end end - describe :audit_usernames do + describe '#audit_usernames' do subject { config.audit_usernames } it("returns false by default") { is_expected.to eq(false) } end - describe :log_format do + describe '#log_format' do subject { config.log_format } it 'returns "text" by default' do |