diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-26 06:06:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-26 06:06:24 +0300 |
commit | d5b4360051cac307d5727df23ef6cff7d90b49a3 (patch) | |
tree | 3a5c26a30da7b4685d41c2c0c6cd1dc6af70d7c5 /spec/lib/gitlab/ci | |
parent | 9615736987b94a783845354ba881008e49d39238 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/ci')
-rw-r--r-- | spec/lib/gitlab/ci/cron_parser_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/cron_parser_spec.rb b/spec/lib/gitlab/ci/cron_parser_spec.rb index af4e9d687c4..385df72fa41 100644 --- a/spec/lib/gitlab/ci/cron_parser_spec.rb +++ b/spec/lib/gitlab/ci/cron_parser_spec.rb @@ -152,6 +152,22 @@ describe Gitlab::Ci::CronParser do end end end + + context 'when time crosses a Daylight Savings boundary' do + let(:cron) { '* 0 1 12 *'} + + # Note this previously only failed if the time zone is set + # to a zone that observes Daylight Savings + # (e.g. America/Chicago) at the start of the test. Stubbing + # TZ doesn't appear to be enough. + it 'generates day without TZInfo::AmbiguousTime error' do + Timecop.freeze(Time.utc(2020, 1, 1)) do + expect(subject.year).to eq(2020) + expect(subject.month).to eq(12) + expect(subject.day).to eq(1) + end + end + end end end end |