v4.0.2
v4 - We have a release! π
This repo was in ownership limbo for a few years, but now it's getting some TLC. v4 aims to squish some long standing bugs and add a few nice features we've been missing.
All feedback and bug reports are also most welcome. π
Summary of changes
BREAKING Changes
- Dropped support for Rubies < 2.7
- Dropped support for Sidekiq <5
- Dropped support for Rails <5
- Drop
have_enqueued_job
matcher - Mocking
Sidekiq::Pro
'sSidekiq::Batches
is now opt-in and disabled by default
New features
Block syntax π€
Many examples in the README, but here's a teaser:
expect { AwesomeJob.perform_async "Awesome!" }.to enqueue_sidekiq_job(AwesomeJob).with("Awesome!")
#on
chainable matcher βοΈ
Wanna test which queue your job was enqueued on? Go for it:
# Both block style and yee old have_enqueued_sidekiq_job style supports it
expect { AwesomeJob.set(queue: "high").perform_async }.to enqueue_sidekiq_job(AwesomeJob).on("high")
expect(AwesomeJob).to have_enqueued_sidekiq_job.on("high")
RSpec builtin args matchers π
Finally you can use those lovely builtin Args matchers from rspec-mocks
expect {
AwesomeJob.perform_async({ "important_arg" => true })
}.to enqueue_sidekiq_job(AwesomeJob).with(hash_including("important_arg" => boolean))
# or using the non-block style
expect(AwesomeJob).to have_enqueued_sidekiq_job(hash_including("important_arg" => boolean))
PR list
Many other bug fixes, and enhancements have gone into v4 as well. Here's all the PRs.
- π Hi I'm the new maintainer by @wspurgin in #190
- Support Sidekiq 7 by @wspurgin in #192
- Update Batches mocking to be opt-in by @wspurgin in #193
- Correct evaluation for "in" option by @wspurgin in #194
- Update failure message to list out actual jobs line-by-line by @wspurgin in #195
- Ignore argument check when expected_arguments empty by @teckwan in #196
- Add
#on
matcher by @wspurgin in #197 - π Fix be_delayed interval calculation by @wspurgin in #198
- Remove have_enqueued_job and rename files/class by @wspurgin in #199
- Use ArgumentListMatcher to ensure order and allow use of richer builtin Argument matchers by @wspurgin in #200
- Block syntax
enqueue_sidekiq_job
by @wspurgin in #201
v4.0.1
- Restore normalizing args to fix unintentional breaking change with symbols #205
v4.0.2
- Explicitly require
forwardable
#204
New Contributors
- @wspurgin made their first contribution in #190
- @teckwan made their first contribution in #196
- @ksss made their first contribution in #204
Full Changelog: v3.1.0...v4.0.2