2020-04-24 11:09:37 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-06-17 02:08:43 -04:00
|
|
|
require 'fast_spec_helper'
|
2020-04-24 11:09:37 -04:00
|
|
|
require_relative '../../../../rubocop/cop/gitlab/change_timzone'
|
|
|
|
|
2021-01-07 13:10:38 -05:00
|
|
|
RSpec.describe RuboCop::Cop::Gitlab::ChangeTimezone do
|
2020-04-24 11:09:37 -04:00
|
|
|
subject(:cop) { described_class.new }
|
|
|
|
|
|
|
|
context 'Time.zone=' do
|
|
|
|
it 'registers an offense with no 2nd argument' do
|
2020-05-28 17:08:22 -04:00
|
|
|
expect_offense(<<~PATTERN)
|
2020-04-24 11:09:37 -04:00
|
|
|
Time.zone = 'Awkland'
|
2021-01-26 13:09:30 -05:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^ Do not change timezone in the runtime (application or rspec), it could result [...]
|
2020-04-24 11:09:37 -04:00
|
|
|
PATTERN
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|