Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

have_enqueued_job clashes with rspec-rails 3.4.0 #83

Closed
JonRowe opened this issue Nov 12, 2015 · 10 comments
Closed

have_enqueued_job clashes with rspec-rails 3.4.0 #83

JonRowe opened this issue Nov 12, 2015 · 10 comments

Comments

@JonRowe
Copy link

JonRowe commented Nov 12, 2015

In rspec-rails we implemented support for asserting on wether or not an ActiveJob has been queued, unfortunately we used have_enqueued_job as the name for this matcher as we were unaware of this gem. This means that rspec-sidekiq will now clash with rspec-rails.

Given that our matcher is more generic I propose that the have_enqueued_job matcher in rspec-sidekiq be renamed to have_enqueued_sidekiq_job and then aliased back to have_enqueued_job when it's not otherwise defined. (We use the alias trick a fair bit in rspec-expectations to provide extra grammar for matchers so it's a pretty accepted technique).

I'd be happy to work on a PR for this if it's acceptable to you :)

@mhenrixon
Copy link

👍

@aprescott
Copy link
Contributor

I see @mrbrdo issued #84 for this fix. Until that gets reviewed, merged and included in a release, is there a temporary work-around I can use to unblock gem updates?

@aprescott
Copy link
Contributor

Think I got one, actually:

# Temporarily work around a clash between rspec-rails 3.4.0 and
# rspec-sidekiq because of new ActiveJob matchers.
#
# See philostler/rspec-sidekiq#83
module RSpec
  module Sidekiq
    module Matchers
      def have_enqueued_sidekiq_job(*expected_arguments)
        HaveEnqueuedSidekiqJob.new expected_arguments
      end

      HaveEnqueuedSidekiqJob = HaveEnqueuedJob
    end
  end
end

@mrbrdo
Copy link

mrbrdo commented Nov 17, 2015

Or just use my branch in your gemfile.

@aprescott
Copy link
Contributor

Git refs in a Gemfile lead to bulky vendor/cache directories, so I try to avoid them.

@fabn
Copy link

fabn commented Dec 7, 2015

@philostler any ETA for this? I'd like to upgrade RSpec but this issue prevent me to do that.

@philostler
Copy link
Collaborator

Been busy with work etc recently, will review all PRs and Issues very soon.

@bkoltai
Copy link

bkoltai commented Jan 19, 2016

+1 for PR!

@nickcoyne
Copy link

nickcoyne commented May 25, 2016

Was the PR not merged?

@philostler
Copy link
Collaborator

This should be fixed with #95 now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants