Sha256: 2f8815d12b7204813596894db385e5fa02d78242db6d1f1143538e9a69c4286f

Contents?: true

Size: 243 Bytes

Versions: 12

Compression:

Stored size: 243 Bytes

Contents

FactoryGirl.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
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
kuroko2-0.4.2 spec/factories/job_schedule_factory.rb
kuroko2-0.4.1 spec/factories/job_schedule_factory.rb
kuroko2-0.4.0 spec/factories/job_schedule_factory.rb
kuroko2-0.3.4 spec/factories/job_schedule_factory.rb
kuroko2-0.3.3 spec/factories/job_schedule_factory.rb
kuroko2-0.3.2 spec/factories/job_schedule_factory.rb
kuroko2-0.3.1 spec/factories/job_schedule_factory.rb
kuroko2-0.3.0 spec/factories/job_schedule_factory.rb
kuroko2-0.2.3 spec/factories/job_schedule_factory.rb
kuroko2-0.2.2 spec/factories/job_schedule_factory.rb
kuroko2-0.2.1 spec/factories/job_schedule_factory.rb
kuroko2-0.2.0 spec/factories/job_schedule_factory.rb