diff options
Diffstat (limited to 'spec/lib/gitlab/app_logger_spec.rb')
-rw-r--r-- | spec/lib/gitlab/app_logger_spec.rb | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/spec/lib/gitlab/app_logger_spec.rb b/spec/lib/gitlab/app_logger_spec.rb index 85ca60d539f..149c3d1f19f 100644 --- a/spec/lib/gitlab/app_logger_spec.rb +++ b/spec/lib/gitlab/app_logger_spec.rb @@ -2,26 +2,12 @@ require 'spec_helper' -RSpec.describe Gitlab::AppLogger do +RSpec.describe Gitlab::AppLogger, feature_category: :shared do subject { described_class } - it 'builds two Logger instances' do - expect(Gitlab::Logger).to receive(:new).and_call_original - expect(Gitlab::JsonLogger).to receive(:new).and_call_original + specify { expect(described_class.primary_logger).to be Gitlab::AppJsonLogger } - 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 - - it 'logs info to only the AppJsonLogger when unstructured logs are disabled' do - stub_env('UNSTRUCTURED_RAILS_LOG', 'false') - expect_any_instance_of(Gitlab::AppTextLogger).not_to receive(:info).and_call_original + it 'logs to AppJsonLogger' do expect_any_instance_of(Gitlab::AppJsonLogger).to receive(:info).and_call_original subject.info('Hello World!') |