Sha256: 7ac2941815d89bcb52d59282e07ecc223ab7db3f9eaa9116c71f3fbe31289dcd
Contents?: true
Size: 835 Bytes
Versions: 75
Compression:
Stored size: 835 Bytes
Contents
require 'sucker_punch' # Include this in your tests to simulate # immediate execution of your asynchronous jobs # # class LogJob # include SuckerPunch::Job # # def perform(*args) # # log the things # end # end # # To trigger asynchronous job: # # LogJob.perform_async(1, 2, 3) # # Include inline testing lib: # # require 'sucker_punch/testing/inline' # # LogJob.perform_async(1, 2, 3) is now synchronous # LogJob.perform_in(1, 2, 3) is now synchronous # module SuckerPunch module Job module ClassMethods def perform_async(*args) self.new.perform(*args) end ruby2_keywords(:perform_async) if respond_to?(:ruby2_keywords, true) def perform_in(_, *args) self.new.perform(*args) end ruby2_keywords(:perform_in) if respond_to?(:ruby2_keywords, true) end end end
Version data entries
75 entries across 75 versions & 2 rubygems