diff options
author | Jacob Vosmaer (GitLab) <jacob@gitlab.com> | 2018-04-09 12:05:28 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-04-09 12:05:28 +0000 |
commit | 17f4731fcf5c38185cdc8aab450d708c0618aa2f (patch) | |
tree | 516bad39079225dc0f16f2f45e03ff381ce2fdd4 /spec/gitlab_logger_spec.rb | |
parent | 69941f9075b64e8ed518a33e87b00c52169f4dbf (diff) | |
download | gitlab-shell-17f4731fcf5c38185cdc8aab450d708c0618aa2f.tar.gz |
Add missing GitlabLogger#error method
Diffstat (limited to 'spec/gitlab_logger_spec.rb')
-rw-r--r-- | spec/gitlab_logger_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/gitlab_logger_spec.rb b/spec/gitlab_logger_spec.rb index eec6648..934b6fa 100644 --- a/spec/gitlab_logger_spec.rb +++ b/spec/gitlab_logger_spec.rb @@ -38,6 +38,24 @@ describe GitlabLogger do end end + describe '#error' do + context 'when the log level is too high' do + let(:level) { Logger::FATAL } + + it 'does nothing' do + subject.info('hello world') + + expect(output.string).to eq('') + end + end + + it 'logs data' do + subject.error('hello world', foo: 'bar') + + expect(first_line).to eq('time="1973-11-29T21:33:09+00:00" level=error msg="hello world" foo=bar pid=1234') + end + end + describe '#info' do context 'when the log level is too high' do let(:level) { Logger::ERROR } |