Skip to content

Commit

Permalink
Load forwardable expressly (#204)
Browse files Browse the repository at this point in the history
Sidekiq v6 does not load forwardable by `require 'sidekiq'; require 'sidekiq/testing'`
Therefore, depending on the library situation used, a `NameError` will be raised.

```
$ BUNDLE_GEMFILE=gemfiles/sidekiq6_5_rails7.gemfile bundle exec ruby -I lib -r rspec-sidekiq -e 1
/rspec-sidekiq/lib/rspec/sidekiq/matchers/base.rb:85:in `<class:EnqueuedJob>': uninitialized constant RSpec::Sidekiq::Matchers::EnqueuedJob::Forwardable (NameError)

        extend Forwardable
               ^^^^^^^^^^^
```

Explicitly loading forwardable solves the problem.
  • Loading branch information
ksss authored Aug 24, 2023
1 parent 08c3020 commit 857d274
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rspec-sidekiq.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'forwardable'

require 'sidekiq'
require 'sidekiq/testing'

Expand Down

0 comments on commit 857d274

Please sign in to comment.