We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
With ruby3.3.0dev (I tried: ruby/ruby@6e38076 ), shoulda-matcher (strictly speaking of Fedora: rubygem-shoulda-matchers-5.1.0-3.fc39 : https://src.fedoraproject.org/rpms/rubygem-shoulda-matchers/c/385e2e375340c40880ef1182320753e1b3c7f982) rspec spec/unit fails like:
rspec spec/unit
Failures: 1) Shoulda::Matchers::Independent::DelegateMethodMatcher qualified with #allow_nil when delegating manually when the delegating method does not account for the delegate object being nil rejects with the correct failure message Failure/Error: country.hello NoMethodError: undefined method `hello' for nil # ./spec/unit/shoulda/matchers/independent/delegate_method_matcher_spec.rb:635:in `hello' # ./lib/shoulda/matchers/independent/delegate_method_matcher.rb:423:in `public_send' # ./lib/shoulda/matchers/independent/delegate_method_matcher.rb:423:in `block in call_delegating_method_with_delegate_method_returning' # ./lib/shoulda/matchers/doublespeak/world.rb:29:in `with_doubles_activated' # ./lib/shoulda/matchers/independent/delegate_method_matcher.rb:422:in `call_delegating_method_with_delegate_method_returning' # ./lib/shoulda/matchers/independent/delegate_method_matcher.rb:397:in `subject_handles_nil_delegate_object?' # ./lib/shoulda/matchers/independent/delegate_method_matcher.rb:205:in `matches?' # ./spec/unit/shoulda/matchers/independent/delegate_method_matcher_spec.rb:650:in `block (6 levels) in <top (required)>' # /builddir/build/BUILD/spec/support/unit/matchers/fail_with_message_matcher.rb:21:in `block (2 levels) in <module:Matchers>' # ./spec/unit/shoulda/matchers/independent/delegate_method_matcher_spec.rb:653:in `block (5 levels) in <top (required)>' # /usr/share/gems/gems/bundler-2.5.0.dev/libexec/bundle:37:in `block in <top (required)>' # /usr/share/gems/gems/bundler-2.5.0.dev/libexec/bundle:29:in `<top (required)>' 2) Shoulda::Matchers::Independent::DelegateMethodMatcher qualified with #allow_nil when using Forwardable when the delegate object is nil rejects with the correct failure message Failure/Error: subject.public_send(delegating_method, *delegated_arguments) NoMethodError: undefined method `hello' for nil # ./lib/shoulda/matchers/independent/delegate_method_matcher.rb:423:in `public_send' # ./lib/shoulda/matchers/independent/delegate_method_matcher.rb:423:in `block in call_delegating_method_with_delegate_method_returning' # ./lib/shoulda/matchers/doublespeak/world.rb:29:in `with_doubles_activated' # ./lib/shoulda/matchers/independent/delegate_method_matcher.rb:422:in `call_delegating_method_with_delegate_method_returning' # ./lib/shoulda/matchers/independent/delegate_method_matcher.rb:397:in `subject_handles_nil_delegate_object?' # ./lib/shoulda/matchers/independent/delegate_method_matcher.rb:205:in `matches?' # ./spec/unit/shoulda/matchers/independent/delegate_method_matcher_spec.rb:599:in `block (7 levels) in <top (required)>' # /usr/share/gems/gems/activesupport-7.0.8/lib/active_support/core_ext/kernel/reporting.rb:28:in `with_warnings' # /usr/share/gems/gems/activesupport-7.0.8/lib/active_support/core_ext/kernel/reporting.rb:15:in `silence_warnings' # ./spec/unit/shoulda/matchers/independent/delegate_method_matcher_spec.rb:598:in `block (6 levels) in <top (required)>' # /builddir/build/BUILD/spec/support/unit/matchers/fail_with_message_matcher.rb:21:in `block (2 levels) in <module:Matchers>' # ./spec/unit/shoulda/matchers/independent/delegate_method_matcher_spec.rb:603:in `block (5 levels) in <top (required)>' # /usr/share/gems/gems/bundler-2.5.0.dev/libexec/bundle:37:in `block in <top (required)>' # /usr/share/gems/gems/bundler-2.5.0.dev/libexec/bundle:29:in `<top (required)>' Finished in 5 minutes 29 seconds (files took 8.26 seconds to load) 2485 examples, 2 failures
(Line number may differ from vanilla shoulda-matchers 5.1.0)
This is due to the following change: ruby/ruby#6950 https://bugs.ruby-lang.org/issues/18285
NoMethodError messages will change on ruby 3.3. With ruby 3.2.2:
NoMethodError
$ ruby --disable-gems -e "foo = nil ; foo.bar" -e:1:in `<main>': undefined method `bar' for nil:NilClass (NoMethodError)
With ruby3.3.0dev:
$ ruby --disable-gems -e "foo = nil ; foo.bar" -e:1:in `<main>': undefined method `bar' for nil (NoMethodError)
The text was updated successfully, but these errors were encountered:
fix: catch ruby3.3 format NoMethodError message
c96d2d9
ruby3.3.0dev changes the error messages on NoMethodError with the following commit / issue: ruby/ruby#6950 https://bugs.ruby-lang.org/issues/18285 So to catch this new NoMethodError message, modify regex accordingly. Fixes thoughtbot#1578 .
fix: catch ruby3.3 format NoMethodError message (#1579)
3654e5c
ruby3.3.0dev changes the error messages on NoMethodError with the following commit / issue: ruby/ruby#6950 https://bugs.ruby-lang.org/issues/18285 So to catch this new NoMethodError message, modify regex accordingly. Fixes #1578 .
Successfully merging a pull request may close this issue.
With ruby3.3.0dev (I tried: ruby/ruby@6e38076 ), shoulda-matcher (strictly speaking of Fedora: rubygem-shoulda-matchers-5.1.0-3.fc39 : https://src.fedoraproject.org/rpms/rubygem-shoulda-matchers/c/385e2e375340c40880ef1182320753e1b3c7f982)
rspec spec/unit
fails like:(Line number may differ from vanilla shoulda-matchers 5.1.0)
This is due to the following change:
ruby/ruby#6950
https://bugs.ruby-lang.org/issues/18285
NoMethodError
messages will change on ruby 3.3.With ruby 3.2.2:
With ruby3.3.0dev:
The text was updated successfully, but these errors were encountered: