Sha256: 2b22f09ae3d5fda7d9958fad9324cbb8c5a7c51c7363e1d151d1f2492e3c1575
Contents?: true
Size: 785 Bytes
Versions: 76
Compression:
Stored size: 785 Bytes
Contents
require 'sucker_punch' # Include this in your tests to simulate # a fake job queue. Jobs won't be executed # as they normal would be the thread pool. # They'll instead be pushed to a fake queue # to be checked in a test environment. # # Include in your test_helper.rb: # # require 'sucker_punch/testing' # # In your application code: # # LogJob.perform_async(1, 2, 3) # # In your tests: # # LogJob.jobs => [{ "args" => [1, 2, 3]] module SuckerPunch module Job def self.jobs SuckerPunch::Queue.find_or_create(self.to_s) end def self.clear_all end end class Queue def self.find_or_create(name, _number_workers = 2, _num_jobs_max = nil) QUEUES.fetch_or_store(name) do [] end end def kill true end end end
Version data entries
76 entries across 76 versions & 2 rubygems