Skip to content

Commit

Permalink
Fix Mocha compatibility
Browse files Browse the repository at this point in the history
RSpec Mocks happened to load its configuration, use the default syntax
and define `any_instance` on `Class` before Mocha had a chance to in
case `rspec/rails` was required in `spec/spec_helper.rb`.

fixes #2252
  • Loading branch information
pirj committed Jan 8, 2020
1 parent 86a5c1f commit ac886dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rspec/rails/matchers/have_enqueued_mail.rb
@@ -1,4 +1,4 @@
require "rspec/mocks"
require "rspec/mocks/argument_matchers"
require "rspec/rails/matchers/active_job"

module RSpec
Expand All @@ -11,7 +11,7 @@ module Matchers
class HaveEnqueuedMail < ActiveJob::HaveEnqueuedJob
MAILER_JOB_METHOD = 'deliver_now'.freeze

include RSpec::Mocks::ExampleMethods
include RSpec::Mocks::ArgumentMatchers

def initialize(mailer_class, method_name)
super(nil)
Expand Down

0 comments on commit ac886dc

Please sign in to comment.