Comments (3)
Hi there. OK, so your calling Sidekiq::Testing.disable!
so you may test against an actual instance of Redis? Your right in that the matcher doesn't cater for that, but your Gist appears to be doing the correct logic to test that scenario.
Your code looks good, would you be willing to start a pull request with that change? I'd like to roll that into the matcher as I can see it being useful for others.
from rspec-sidekiq.
There is one thing to consider. When the job is enqueued with perform_at
method the job will be enqueued in the schedule
queue. The way to inspect this queue is to simply: ::Sidekiq::ScheduledSet.new.map(&:item)
. I thought about appending those items to the @actual
in the have_enqueued_job
matcher. But that would make the corresponding spec file more complicated. So either we refactor the spec file or we add another matcher named have_scheduled_job
or something similar.
from rspec-sidekiq.
I like the idea of a have_scheduled_job
matcher alongside the have_enqueued_job
. They are separate enough to warrant a separate matcher and indeed would make for simpler specs. Will have to weight this up against an alternative syntax such as have_enqueued_job#at
from rspec-sidekiq.
Related Issues (20)
- Testing the negative case of have_enqueued_sidekiq_job with any arguments? HOT 10
- be_retryable not using global settings HOT 2
- Checking for time has a different format expectation HOT 1
- has_enqueued_sidekiq_job is not matching even though they are identical HOT 7
- Disable all sidekiq jobs for testing HOT 1
- Block syntax `enqueue_sidekiq_job` matcher HOT 8
- Issue with yaml safe loading (psych gem) HOT 2
- `be_delayed` without expected_arguments never matches HOT 4
- RSpec::Sidekiq::NullStatus is missing pending count
- Using ActiveJob::Base with sidekiq_options raises an error HOT 5
- difference in DST handling between Sidekiq's `perform_in` and `have_enqueued_sidekiq_job`
- How to expect to have_enqueued_sidekiq_job with specific queue? - [setting queue name at runtime] HOT 1
- Does this gem need a new owner? HOT 17
- Null Object method missing for Null Batch masks NoMethod errors
- Support Sidekiq 7 and deprecate be_delayed matcher
- Potentially unintentional breaking change in 4.0 with Symbol in argument matchers? HOT 15
- Potentially unintentional breaking change in 4.0.2 with Symbol in argument matchers? (Part 2) HOT 6
- NameError: uninitialized constant RSpec::Matchers::Composable HOT 5
- Match on custom context HOT 1
- feature request: negative matchers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rspec-sidekiq.