summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/log_timestamp_formatter_spec.rb
blob: e06baa2324fd38adebc80629c9f1d274e235b03a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::LogTimestampFormatter do
  subject { described_class.new }

  let(:formatted_timestamp) { Time.now.utc.iso8601(3) }

  it 'logs the timestamp in UTC and ISO8601.3 format' do
    Timecop.freeze(Time.now) do
      expect(subject.call('', Time.now, '', '')).to include formatted_timestamp
    end
  end
end