Rspec-core: Confirm Proc Equality Fix Proposed for Ruby Core

Created on 18 Jun 2020  路  2Comments  路  Source: rspec/rspec-core

Myron Marston created in issue on the Ruby core bugtracker in January 2018 about a regression in rspec caused by lazy-proc allocation (introduced in Ruby 2.5). He worked around the issue in rspec in 84670489bb4943a62e783bd65f96e4b55360b141. Here's a link to the issue report Myron added: https://bugs.ruby-lang.org/issues/14267

I've implemented support in Ruby so that the workaround should no longer be necessary. I would like you to confirm that rspec works with the workaround removed using the patched Ruby. If so, we can merge the patch into Ruby, and eventually rspec will be able to drop the workaround. The patch for Ruby is located at https://github.com/ruby/ruby/pull/3174.

Most helpful comment

Awesome! Thank you very much for your quick testing. I expect to merge the patch into Ruby this week.

All 2 comments

Thanks a lot @jeremyevans!

Confirming, the fix works as expected.

Reproduction script:

rvm install ruby-head --disable-binary --patch https://patch-diff.githubusercontent.com/raw/ruby/ruby/pull/3174.patch
rvm use --create ruby-head@rspec-core
git revert 84670489bb4943a62e783bd65f96e4b55360b141
bundle
rspec

On 2.7.1:

rspec ./spec/rspec/core/hooks_filtering_spec.rb:168 # config block hook filtering when hooks are defined after a group has been defined only runs context hooks around the highest level group with matching filters
rspec ./spec/rspec/core/hooks_filtering_spec.rb:42 # config block hook filtering when hooks are defined after a group has been defined applies only to groups with matching metadata
rspec ./spec/rspec/core/hooks_filtering_spec.rb:4 # config block hook filtering when hooks are defined after a group has been defined still applies

2166 examples, 3 failures, 3 pending

Or ruby-head with the patch (reports itself as 2.8.0):

2166 examples, 0 failures, 3 pending

Awesome! Thank you very much for your quick testing. I expect to merge the patch into Ruby this week.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

take picture take  路  5Comments

andyl picture andyl  路  6Comments

Drenmi picture Drenmi  路  4Comments

ankit8898 picture ankit8898  路  3Comments

alexcoplan picture alexcoplan  路  3Comments