Sha256: 469887d3c2edf7962a144d2fe61ad5b9e4d8e790b6193c29629566cc3bc662fb

Contents?: true

Size: 262 Bytes

Versions: 6

Compression:

Stored size: 262 Bytes

Contents

FactoryBot.define do
  factory :job_schedule, class: Kuroko2::JobSchedule do
    sequence(:cron) do |n|
      hour = n > 60 ? (n / 60) : '*'
      day  = n > 60 * 24 ? n / 60 % 24 : '*'

      "#{n % 60} #{hour} #{day} * *"
    end

    job_definition
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kuroko2-0.8.0 spec/factories/job_schedule_factory.rb
kuroko2-0.7.0 spec/factories/job_schedule_factory.rb
kuroko2-0.6.0 spec/factories/job_schedule_factory.rb
kuroko2-0.5.2 spec/factories/job_schedule_factory.rb
kuroko2-0.5.1 spec/factories/job_schedule_factory.rb
kuroko2-0.5.0 spec/factories/job_schedule_factory.rb