diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 00:07:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 00:07:39 +0300 |
commit | 74a89b1221eaf780374bd1d4c5b2ee4a0f488908 (patch) | |
tree | 27dbcfdbc4216e9bee04b9be9c974d86744d51ba /spec/lib/gitlab/app_logger_spec.rb | |
parent | b0abae12affecc466aeb10889e8a6c000d6f67f5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/app_logger_spec.rb')
-rw-r--r-- | spec/lib/gitlab/app_logger_spec.rb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/spec/lib/gitlab/app_logger_spec.rb b/spec/lib/gitlab/app_logger_spec.rb index 3b21104b15d..132a10b9409 100644 --- a/spec/lib/gitlab/app_logger_spec.rb +++ b/spec/lib/gitlab/app_logger_spec.rb @@ -2,13 +2,21 @@ require 'spec_helper' -describe Gitlab::AppLogger, :request_store do +describe Gitlab::AppLogger do subject { described_class } - it 'builds a logger once' do - expect(::Logger).to receive(:new).and_call_original + it 'builds a Gitlab::Logger object twice' do + expect(Gitlab::Logger).to receive(:new) + .exactly(described_class.loggers.size) + .and_call_original - subject.info('hello world') - subject.error('hello again') + subject.info('Hello World!') + end + + it 'logs info to AppLogger and AppJsonLogger' do + expect_any_instance_of(Gitlab::AppTextLogger).to receive(:info).and_call_original + expect_any_instance_of(Gitlab::AppJsonLogger).to receive(:info).and_call_original + + subject.info('Hello World!') end end |