2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Gitlab::AppLogger do
|
2018-03-17 18:26:18 +05:30
|
|
|
subject { described_class }
|
|
|
|
|
2020-03-09 13:42:32 +05:30
|
|
|
it 'builds a Gitlab::Logger object twice' do
|
|
|
|
expect(Gitlab::Logger).to receive(:new)
|
|
|
|
.exactly(described_class.loggers.size)
|
|
|
|
.and_call_original
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2020-03-09 13:42:32 +05:30
|
|
|
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!')
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
|
|
|
end
|