// the find
wspurgin/rspec-sidekiq
RSpec for Sidekiq
A Ruby test helper for Sidekiq jobs. It provides RSpec matchers for enqueueing, scheduling, queue selection, retry, and uniqueness options, plus helpers that stub the scheduled, retry, and dead sets so tests run without Redis. It is aimed at teams running Sidekiq who want job assertions in RSpec without wiring up Sidekiq::Testing themselves.
The matchers chain and compose well: enqueue_sidekiq_job(...).with(...).on(...).at(...).with_context(...) reads clearly, and .and composes multiple expectations in one block. The gemfiles directory covers Sidekiq 5 through 8 across Rails 6 through 8, which matters for teams stuck on older Sidekiq versions. stub_named_queues backs ScheduledSet, RetrySet, and DeadSet with an in-memory JobStore, so retry and dead-job assertions run without a Redis instance. The config defaults clear all queues before each example and warn when jobs go to the job array instead of Redis, which catches the common mistake of a job landing in the wrong mode.
be_delayed is still shipped and documented even though Sidekiq 7 removed delayed extensions and the matcher now raises on Sidekiq 7+. It is dead weight for most users and still shows up in the README. stub_batches uses a NullObject that responds to any method, so a typo in the batch API passes silently, and the README admits this. A green test can hide broken code. be_unique is documented as Enterprise-only with limited, non-guaranteed support for sidekiq-unique-jobs, so open-source unique-jobs users are mostly on their own. The in-memory JobStore is a second implementation of the set APIs that has to track Sidekiq internals, and the README does not say where its behaviour diverges from a real Redis-backed set.