2020-05-24 23:13:21 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
require 'rubocop_spec_helper'
|
2021-12-11 22:18:48 +05:30
|
|
|
require_relative '../../../../rubocop/cop/gitlab/change_timezone'
|
2020-05-24 23:13:21 +05:30
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
RSpec.describe RuboCop::Cop::Gitlab::ChangeTimezone do
|
2020-05-24 23:13:21 +05:30
|
|
|
context 'Time.zone=' do
|
|
|
|
it 'registers an offense with no 2nd argument' do
|
2020-06-23 00:09:42 +05:30
|
|
|
expect_offense(<<~PATTERN)
|
2020-05-24 23:13:21 +05:30
|
|
|
Time.zone = 'Awkland'
|
2021-03-11 19:13:27 +05:30
|
|
|
^^^^^^^^^^^^^^^^^^^^^ Do not change timezone in the runtime (application or rspec), it could result [...]
|
2020-05-24 23:13:21 +05:30
|
|
|
PATTERN
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|