ixti / sidekiq-throttled

Concurrency and rate-limit throttling for Sidekiq
MIT License
717 stars 78 forks source link

Rspec testing! How to do it ?? #114

Open RichardsonWTR opened 2 years ago

RichardsonWTR commented 2 years ago

Given this situation:

# config/initializers/sidekiq.rb file
Sidekiq::Throttled::Registry.add(
  :my_throttle,
  concurrency: { limit: 50 }
)

# app/jobs/my_job.rb  file
class MyJob
  include Sidekiq::Worker
  include Sidekiq::Throttled::Worker
  sidekiq_throttle_as :my_throttle
end

How can I write tests in Rspec that assures:

I've tried some things but still no luck. Any help will be useful.

Related #62

ixti commented 1 year ago

Re:

We will need to add rspec matchers to simplify this task.


Re: