dgollahon/rspectre

Fix ruby 3.x compatibility

Closed this issue · 2 comments

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.

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.

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.