diff --git a/lib/sidekiq-cron.rb b/lib/sidekiq-cron.rb index 8b3ae615..9e140e51 100644 --- a/lib/sidekiq-cron.rb +++ b/lib/sidekiq-cron.rb @@ -1,2 +1,7 @@ require "sidekiq" require "sidekiq/cron" +require "sidekiq/cron/job" +require "sidekiq/cron/namespace" +require "sidekiq/cron/poller" +require "sidekiq/cron/launcher" +require "sidekiq/cron/schedule_loader" diff --git a/lib/sidekiq/cron.rb b/lib/sidekiq/cron.rb index b8d18291..f72e4f6b 100644 --- a/lib/sidekiq/cron.rb +++ b/lib/sidekiq/cron.rb @@ -1,8 +1,3 @@ -require "sidekiq/cron/job" -require "sidekiq/cron/namespace" -require "sidekiq/cron/poller" -require "sidekiq/cron/launcher" - module Sidekiq module Cron class << self diff --git a/lib/sidekiq/cron/launcher.rb b/lib/sidekiq/cron/launcher.rb index 71b2fed6..f8a1366a 100644 --- a/lib/sidekiq/cron/launcher.rb +++ b/lib/sidekiq/cron/launcher.rb @@ -1,3 +1,4 @@ +require 'sidekiq/cron' require 'sidekiq/cron/poller' # For Cron we need to add some methods to Launcher diff --git a/test/unit/launcher_test.rb b/test/unit/launcher_test.rb index d8192560..48ed507e 100644 --- a/test/unit/launcher_test.rb +++ b/test/unit/launcher_test.rb @@ -8,7 +8,7 @@ it 'initializes poller with default poll interval when not configured' do Sidekiq::Cron::Poller.expects(:new).with do |options| - assert_equal 30, options[:cron_poll_interval] + assert_equal Sidekiq::Cron.configuration.cron_poll_interval, options[:cron_poll_interval] end Sidekiq::Launcher.new(Sidekiq::Options.config) @@ -16,7 +16,7 @@ it 'initializes poller with the configured poll interval' do Sidekiq::Cron::Poller.expects(:new).with do |options| - assert_equal 99, options[:cron_poll_interval] + assert_equal Sidekiq::Cron.configuration.cron_poll_interval, options[:cron_poll_interval] end Sidekiq::Cron.configuration.cron_poll_interval = 99