diff options
Diffstat (limited to 'spec/lib/gitlab/ci/cron_parser_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/cron_parser_spec.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/lib/gitlab/ci/cron_parser_spec.rb b/spec/lib/gitlab/ci/cron_parser_spec.rb index 4b750cf3bcf..2c07e4d2224 100644 --- a/spec/lib/gitlab/ci/cron_parser_spec.rb +++ b/spec/lib/gitlab/ci/cron_parser_spec.rb @@ -37,7 +37,7 @@ RSpec.describe Gitlab::Ci::CronParser do end end - context 'when slash used' do + context 'when */ used' do let(:cron) { '*/10 */6 */10 */10 *' } let(:cron_timezone) { 'UTC' } @@ -63,7 +63,7 @@ RSpec.describe Gitlab::Ci::CronParser do end end - context 'when range and slash used' do + context 'when range and / are used' do let(:cron) { '3-59/10 * * * *' } let(:cron_timezone) { 'UTC' } @@ -74,6 +74,17 @@ RSpec.describe Gitlab::Ci::CronParser do end end + context 'when / is used' do + let(:cron) { '3/10 * * * *' } + let(:cron_timezone) { 'UTC' } + + it_behaves_like returns_time_for_epoch + + it 'returns specific time' do + expect(subject.min).to be_in([3, 13, 23, 33, 43, 53]) + end + end + context 'when cron_timezone is TZInfo format' do before do allow(Time).to receive(:zone) |