2019-07-25 01:21:37 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-10-19 02:41:55 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-01-13 16:07:39 -05:00
|
|
|
describe Gitlab::AppLogger do
|
2017-10-19 02:41:55 -04:00
|
|
|
subject { described_class }
|
|
|
|
|
2020-01-13 16:07:39 -05:00
|
|
|
it 'builds a Gitlab::Logger object twice' do
|
|
|
|
expect(Gitlab::Logger).to receive(:new)
|
|
|
|
.exactly(described_class.loggers.size)
|
|
|
|
.and_call_original
|
2017-10-19 02:41:55 -04:00
|
|
|
|
2020-01-13 16:07:39 -05:00
|
|
|
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!')
|
2017-10-19 02:41:55 -04:00
|
|
|
end
|
|
|
|
end
|