-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Issue with RSpec::Matchers.define_negated_matcher and active_support/core_ext/object/with.rb #49958
Comments
I'm trying to run your repro script, but it doesn't execute the tests, how do you do that? |
Nevermind, it's just missing |
I think,
Should we do only |
Doh, thank you. Sorry, I was running it using nvim-test, which just did the right thing for me 😅 |
@fatkodima that's not the issue. |
Ok. I found the issue. The clean fix would be for it to inherit from As a quick workaround you can add: Rspec::Matchers::AliasedNegatedMatcher.undef_method(:with) In you |
Awesome, that unblocked me! Thank you for looking at this! <3 |
Not quite production ready, but the clean fix will look something like that: rspec/rspec-expectations#1434 I'll try to polish it tomorrow. Now if you don't mind, given this isn't a Rails bug, I'll close. |
Hello!
We are running into an issue that was introduced when upgrading from rails 7.0.8 to 7.1.1, which is triggered by the newly added
Object#with
method.Steps to reproduce
with
(ex:enqueue_job.with('foo')
)with
Object#with
, as defined inactivesupport-7.1.1/lib/active_support/core_ext/object/with.rb
Expected behavior
The test passes.
Actual behavior
Notes:
This is happening with a few different matchers we use, not just the
not_enqueue_job
one. We are using these negated matchers because we have a lot of specs that assert a couple different things using.and <negated_matcher>
.Rspec-mocks ran into a similar issue as this: rspec/rspec-mocks#1530.
System configuration
Rails version:
7.1.1
Ruby version:
3.2.2
The text was updated successfully, but these errors were encountered: