debian-mirror-gitlab/spec/lib/gitlab/puma_logging/json_formatter_spec.rb
2020-08-09 17:44:08 +05:30

12 lines
391 B
Ruby

# 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