Skip to content

Commit

Permalink
Merge pull request #2256 from rspec/fix-mocha-compatibility
Browse files Browse the repository at this point in the history
Fix Mocha compatibility
  • Loading branch information
pirj authored and JonRowe committed Jan 12, 2020
1 parent cce6f9b commit 7819b22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Expand Up @@ -38,6 +38,7 @@ Bug Fixes:
(Takumi Shotoku, #2188)
* Prevent a `WrongScopeError` being thrown during loading fixtures on Rails
6.1 development version. (Edouard Chin, #2215)
* Fix Mocha mocking support with `should`. (Phil Pirozhkov, #2256)

Breaking Changes:

Expand Down
7 changes: 5 additions & 2 deletions lib/rspec/rails/matchers/have_enqueued_mail.rb
@@ -1,4 +1,7 @@
require "rspec/mocks"
# We require the minimum amount of rspec-mocks possible to avoid
# conflicts with other mocking frameworks.
# See: https://github.com/rspec/rspec-rails/issues/2252
require "rspec/mocks/argument_matchers"
require "rspec/rails/matchers/active_job"

module RSpec
Expand All @@ -11,7 +14,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 7819b22

Please sign in to comment.