BigW Consortium Gitlab

Commit 3d3df097 by Shinya Maeda

Dry up next_time_from. Move cron_parser_spec to appropriate location.

parent 914bef67
......@@ -11,11 +11,7 @@ module Gitlab
def next_time_from(time)
cron_line = try_parse_cron(@cron, @cron_time_zone)
if cron_line.present?
cron_line.next_time(time).in_time_zone(Time.zone)
else
nil
end
cron_line.next_time(time).in_time_zone(Time.zone) if cron_line.present?
end
def validation
......
require 'spec_helper'
module Ci
describe CronParser, lib: true do
describe Gitlab::Ci::CronParser do
shared_examples_for "returns time in the future" do
it { is_expected.to be > Time.now }
end
......@@ -102,5 +101,4 @@ module Ci
expect(is_valid_cron_time_zone).to eq(false)
end
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment