Skip to content

Releases: wspurgin/rspec-sidekiq

v5.0.0

15 May 19:31
5becc96
Compare
Choose a tag to compare

Breaking ❗

  • have_enqueued_sidekiq_job() matches jobs with any arguments (same as enqueue_sidekiq_job() or have_enqueued_sidekiq_job(any_args)). Previously it would only match jobs with no args (#215)

New features ✨

You can now specify the number of jobs that should match the expectation! Thanks you @3v0k4 for the much requested feature!

Use via one of the following chainable methods:

  • #once
  • #twice
  • #thrice
  • #exactly(n)
  • #at_least(n)
  • #at_most(n)

Examples:

expect(AwesomeJob).to have_enqueued_sidekiq_job.once
expect(AwesomeJob).to have_enqueued_sidekiq_job.exactly(1).time
expect(AwesomeJob).to have_enqueued_sidekiq_job.exactly(:once)
expect(AwesomeJob).to have_enqueued_sidekiq_job.at_least(1).time
expect(AwesomeJob).to have_enqueued_sidekiq_job.at_least(:once)
expect(AwesomeJob).to have_enqueued_sidekiq_job.at_most(2).times
expect(AwesomeJob).to have_enqueued_sidekiq_job.at_most(:twice)
expect(AwesomeJob).to have_enqueued_sidekiq_job.at_most(:thrice)

PR Changelog

Full Changelog: v4.2.0...v5.0.0

As always, bug reports and additions are always most welcome!

v4.2.0

16 Apr 14:08
Compare
Choose a tag to compare

What's Changed

  • Fix: require matchers explicitly by @wspurgin in #214
  • Warn when using have_enqueued_sidekiq_job with no arguments for upcoming behavior change by @3v0k4 in #216 & #217

New Contributors

Full Changelog: v4.1.0...v4.2.0

v4.1.0

27 Oct 20:15
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v4.0.2...v4.1.0

v4.0.2

15 Aug 13:55
Compare
Choose a tag to compare

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's Sidekiq::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.

v4.0.1

  • Restore normalizing args to fix unintentional breaking change with symbols #205

v4.0.2

  • Explicitly require forwardable #204

New Contributors

Full Changelog: v3.1.0...v4.0.2

4.0.0.pre

09 Aug 20:23
Compare
Choose a tag to compare
4.0.0.pre Pre-release
Pre-release

v4.0.0.pre - We have a (pre)release! 🚀

What needs testing in the wild

I personally don't use ActiveJob basically at all in any project where I use Sidekiq. This is mostly just from longstanding habit since Sidekiq 5 and the known performance drops one encountered when using ActiveJob as a middle-man.

As such, I don't have a place to play around with how testing ActiveJob with v4 works (or doesn't!). If anyone uses ActiveJob with Sidekiq and uses this repo for testing your Sidekiq-ery, please give this prerelease a try and send in issues and feedback.

For all other plain-ol' Sidekiq users, your feedback and bug reports are also most welcome. 😄

v3.1.0

21 Jun 16:26
Compare
Choose a tag to compare

3.1.0

  • Add support for latest ruby and Rails 5 (coding-bunny #156)
  • Support Class#method notation in batch callback (caalberts #155)
  • Fix bug with time comparison in delayed jobs (geeosh #153 with help from col)
  • remove usage of Integer#blank? (lanej #152)
  • Add NullBatch#description (dsantosmerino #139)
  • README updates (BenMusch #142, akihikodaki #141, wpolicarpo #160)

3.0.3

21 Jun 15:40
Compare
Choose a tag to compare
Tick to 3.0.3

Also includes changes from CHANGES.md for 3.0.2, which were forgotten

3.0.2

22 Jun 17:29
Compare
Choose a tag to compare
  • README updates (nilsding #110, packrat386 #122)
  • Ruby 2.4 support (packrat386 #119)
  • Fixes for Sidekiq 5 deprecations (packrat #130 with help from trev)

3.0.1

10 Apr 15:21
Compare
Choose a tag to compare
  • Remove implicit runtime dependency on ActiveSupport [aprescott#109]

3.0.0

04 Apr 18:25
Compare
Choose a tag to compare
  • Use default arguments for NullStatus initialization [briansharon#111]
  • Fix at and in chainable methods [wpolicarpo#109]
  • Rely on all of RSpec in development [packrat386#101]
  • Pass exception to within_sidekiq_retries_exhausted_block [packrat386#100]
  • Add support for testing scheduled jobs [wpolicarpo#81]
  • only depend on rspec-core [urkle#96]
  • Add support for Sidekiq Enterprise [Geesu#82]
  • Fix clash with rspec-rails [pavel-jurasek-bcgdv-com#95]