Skip to content

Commit 44dd31d

Browse files
authored
Merge pull request #2256 from rspec/fix-mocha-compatibility
Fix Mocha compatibility
2 parents 86a5c1f + 38efe12 commit 44dd31d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Bug Fixes:
3838
(Takumi Shotoku, #2188)
3939
* Prevent a `WrongScopeError` being thrown during loading fixtures on Rails
4040
6.1 development version. (Edouard Chin, #2215)
41+
* Fix Mocha mocking support with `should`. (Phil Pirozhkov, #2256)
4142

4243
Breaking Changes:
4344

lib/rspec/rails/matchers/have_enqueued_mail.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
require "rspec/mocks"
1+
# We require the minimum amount of rspec-mocks possible to avoid
2+
# conflicts with other mocking frameworks.
3+
# See: https://github.com/rspec/rspec-rails/issues/2252
4+
require "rspec/mocks/argument_matchers"
25
require "rspec/rails/matchers/active_job"
36

47
module RSpec
@@ -11,7 +14,7 @@ module Matchers
1114
class HaveEnqueuedMail < ActiveJob::HaveEnqueuedJob
1215
MAILER_JOB_METHOD = 'deliver_now'.freeze
1316

14-
include RSpec::Mocks::ExampleMethods
17+
include RSpec::Mocks::ArgumentMatchers
1518

1619
def initialize(mailer_class, method_name)
1720
super(nil)

0 commit comments

Comments
 (0)