debian-mirror-gitlab/spec/rubocop/cop/gitlab/change_timezone_spec.rb

18 lines
510 B
Ruby
Raw Normal View History

2020-05-24 23:13:21 +05:30
# frozen_string_literal: true
2020-07-28 23:09:34 +05:30
require 'fast_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
subject(:cop) { described_class.new }
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