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

Fix Mocha compatibility #2256

Merged
merged 1 commit into from Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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"
pirj marked this conversation as resolved.
Show resolved Hide resolved
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