rails / thor

Thor is a toolkit for building powerful command-line interfaces.
http://whatisthor.com/
MIT License
5.12k stars 552 forks source link

Fix matching when DidYouMean is enabled #771

Closed petergoldstein closed 2 years ago

petergoldstein commented 2 years ago

Because of the changes in Ruby 3.1 to enable DidYouMean for a subset of errors, in a way that is somewhat confusing in specs, rspec-expectations now matches against the original_message, if the Error responds to that method. That avoids having to match the backtrace in these circumstances.

Unfortunately that causes specs like this one - where DidYouMean is being used intentionally - to fail the matcher. This PR updates the spec to avoid use of the matcher.

With this change, specs are now green.

dorner commented 2 years ago

LGTM - @rafaelfranca

deivid-rodriguez commented 2 years ago

This one can be closed now because a similar fix was introduced by #780.