Welcome to mirror list, hosted at ThFree Co, Russian Federation.

json_formatter_spec.rb « puma_logging « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 64ace09e01b6cd7d0480ff2cdd6ab5616e0c5108 (plain)
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::PumaLogging::JSONFormatter do
  it "generate json format with timestamp and pid" do
    Timecop.freeze( Time.utc(2019, 12, 04, 9, 10, 11, 123456)) do
      expect(subject.call('log message')).to eq "{\"timestamp\":\"2019-12-04T09:10:11.123Z\",\"pid\":#{Process.pid},\"message\":\"log message\"}"
    end
  end
end