debian-mirror-gitlab/spec/lib/gitlab/app_logger_spec.rb

23 lines
584 B
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
require 'spec_helper'
2020-03-13 15:44:24 +05:30
describe Gitlab::AppLogger do
2018-03-17 18:26:18 +05:30
subject { described_class }
2020-03-13 15:44:24 +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-13 15:44:24 +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