This repository has been archived by the owner on Nov 30, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 358
Rails 7.1 breaks receive().with #1530
Comments
Why does |
Even then, why would it not redefine existing methods? I'll git blame to see if I can find the reason for this. |
Ah, I think the intent is to not redefine methods directly defined in |
casperisfine
pushed a commit
to casperisfine/rspec-mocks
that referenced
this issue
Mar 7, 2023
Fix: rspec#1530 My understanding of this `next if method_defined?` check that there since this class was added in 08ec2e8 is that it's to prevent accidentally overriding Matcher or own methods. If my understanding is correct, then we should ignore methods inherited from `Object`.
I think I have a fix for it, but GitHub seems to be having issues, I get an error message when trying to create the PR....
|
@byroot I’ve opened one, does it work for you? |
Sure, thank you. |
mshibuya
added a commit
to carrierwaveuploader/carrierwave
that referenced
this issue
Mar 12, 2023
jdelStrother
added a commit
to jdelStrother/thinking-sphinx
that referenced
this issue
Oct 11, 2023
rspec to fix Object#with - rspec/rspec-mocks#1530 database_cleaner to fix "undefined method `table_name' for ActiveRecord::SchemaMigration:Class"
Earlopain
added a commit
to Earlopain/mailgun-ruby
that referenced
this issue
Jan 2, 2024
Fixes test failures with Rails 7.1 rspec/rspec-mocks#1530
Merged
5 tasks
chrislo
added a commit
to RaspberryPiFoundation/editor-api
that referenced
this issue
Jun 11, 2024
We ran bundle update --conservative rspec-mocks We need to update rspec-mocks here since Rails 7.1 introduces a method `with` that clashes with the `with` method provided by rspec-mocks[1]. We're using the latter in the corp_middleware_spec. [1] rspec/rspec-mocks#1530 Co-authored-by: Chris Roos <chris.roos@gofreerange.com>
chrislo
added a commit
to RaspberryPiFoundation/editor-api
that referenced
this issue
Jun 11, 2024
We ran bundle update --conservative rspec-mocks We need to update rspec-mocks here since Rails 7.1 introduces a method `with` that clashes with the `with` method provided by rspec-mocks[1]. We're using the latter in the corp_middleware_spec. [1] rspec/rspec-mocks#1530 Co-authored-by: Chris Roos <chris.roos@gofreerange.com>
chrislo
added a commit
to RaspberryPiFoundation/editor-api
that referenced
this issue
Jun 12, 2024
We ran bundle update --conservative rspec-mocks We need to update rspec-mocks here since Rails 7.1 introduces a method `with` that clashes with the `with` method provided by rspec-mocks[1]. We're using the latter in the corp_middleware_spec. [1] rspec/rspec-mocks#1530 Co-authored-by: Chris Roos <chris.roos@gofreerange.com>
jdelStrother
added a commit
to jdelStrother/thinking-sphinx
that referenced
this issue
Jun 15, 2024
rspec to fix Object#with - rspec/rspec-mocks#1530 database_cleaner to fix "undefined method `table_name' for ActiveRecord::SchemaMigration:Class"
jdelStrother
added a commit
to jdelStrother/thinking-sphinx
that referenced
this issue
Jun 16, 2024
rspec to fix Object#with - rspec/rspec-mocks#1530 database_cleaner to fix "undefined method `table_name' for ActiveRecord::SchemaMigration:Class"
torresga
added a commit
to bikeindex/bike_index
that referenced
this issue
Oct 2, 2024
torresga
added a commit
to bikeindex/bike_index
that referenced
this issue
Oct 7, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Your environment
Steps to reproduce
In a Rails application (i.e., with Rails loaded), define a method expectation:
Expected behavior
Pass.
Actual behavior
What happened?
Rails monkey-patched
Object#with
rails/rails#46681 /cc @byrootRSpec
receive
matcher defines chain methods only for undefined methods:rspec-mocks/lib/rspec/mocks/matchers/receive.rb
Lines 58 to 59 in 4a1032b
Since
#with
is defined onObject
, thewith
modifier is no longer available.The text was updated successfully, but these errors were encountered: