dgollahon / rspectre

Exorcise the apparitions haunting your tests.
MIT License
75 stars 10 forks source link

Fix ruby 3.x compatibility #46

Closed dgollahon closed 1 year ago

dgollahon commented 3 years ago

I am not currently using 3.x but I suspect there may be some issues related to how various arguments get forward and may require using ruby2_keywords. This is just a reminder for me to check if this is a problem or not.

dgollahon commented 2 years ago

There are issues--the naive forwarding breaks in some cases. Here is an example from mutant. This applies to at least shared_examples, but maybe niche uses of other constructs as well. The forwarding should work properly in each version of ruby so I either need to figure out how to get ruby2_keywords to work (the naive thing I tried did not work) or just switch on if 2.7.x is running and forward *args, &blk v.s. *args, **kwargs, &blk based on that.

bquorning commented 1 year ago

After upgrading to Ruby 3.1/3.2 I am also running into this problem with shared_examples taking “block keyword arguments”. I think dropping Ruby 2.7 is a fine approach now that it’s EOL anyway.