rspec / rspec-mocks

RSpec's 'test double' framework, with support for stubbing and mocking
https://rspec.info
MIT License
1.16k stars 356 forks source link

Use a better and more reliable check for whether a method is the same as Class#new #1470

Closed eregon closed 2 years ago

eregon commented 2 years ago

The added test would fail without the change. This also helps for TruffleRuby support (https://github.com/rspec/rspec-metagem/issues/68), as TruffleRuby does not plan to replicate that CRuby inconsistency/bug (https://bugs.ruby-lang.org/issues/18729).

eregon commented 2 years ago

Unfortunately this doesn't seem to work on CRuby master, even though it does work on 3.0 and 3.1. I've filed https://bugs.ruby-lang.org/issues/18751, it seems a CRuby regression.

eregon commented 2 years ago

I fixed that CRuby issue, and with a rerun of main on my fork ruby-head now passes :tada: https://github.com/eregon/rspec-mocks/runs/7931839710?check_suite_focus=true