Sha256: 6a5a4e4efb867b30e241650402da9d64c52226d64774221e5a480a3cdce80162
Contents?: true
Size: 650 Bytes
Versions: 11
Compression:
Stored size: 650 Bytes
Contents
require 'test_helper' module SuckerPunch class AsyncSyntaxTest < Minitest::Test def setup require 'sucker_punch/async_syntax' SuckerPunch::Queue.clear end def teardown SuckerPunch::Queue.clear end def test_perform_async_runs_job_asynchronously arr = Concurrent::Array.new latch = Concurrent::CountDownLatch.new FakeLatchJob.new.async.perform(arr, latch) latch.wait(0.2) assert_equal 1, arr.size end private class FakeLatchJob include SuckerPunch::Job def perform(arr, latch) arr.push true latch.count_down end end end end
Version data entries
11 entries across 11 versions & 1 rubygems