summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/app_logger_spec.rb
blob: 132a10b94095171b0e24dc4e799de804f390d29d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

require 'spec_helper'

describe Gitlab::AppLogger do
  subject { described_class }

  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!')
  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