lib/sidekiq/testing.rb in sidekiq-2.0.3 vs lib/sidekiq/testing.rb in sidekiq-2.1.0
- old
+ new
@@ -22,24 +22,14 @@
# assert_equal 0, Sidekiq::Extensions::DelayedMailer.jobs.size
# MyMailer.delayed.send_welcome_email('foo@example.com')
# assert_equal 1, Sidekiq::Extensions::DelayedMailer.jobs.size
#
module ClassMethods
- alias_method :perform_async_old, :perform_async
- def perform_async(*args)
- jobs << { 'class' => self.name, 'args' => args }
+ alias_method :client_push_old, :client_push
+ def client_push(opts)
+ jobs << opts
true
end
-
- alias_method :perform_in_old, :perform_in
- alias_method :perform_at_old, :perform_at
- def perform_in(interval, *args)
- int = interval.to_f
- ts = (int < 1_000_000_000 ? Time.now.to_f + int : int)
- jobs << { 'class' => self.name, 'args' => args, 'at' => ts }
- true
- end
- alias_method :perform_at, :perform_in
def jobs
@pushed ||= []
end