rspec-expectations icon indicating copy to clipboard operation
rspec-expectations copied to clipboard

Ruby 3.0.3 and keyword arguments

Open enthusiasmus opened this issue 3 years ago • 9 comments

Subject of the issue

When using ruby 3.0.3 manually defined chained rspec matchers with keyword parameters don't forwards the arguments correctly

Your environment

  • Ruby version: 3.0.3
  • rspec-expectations version: 3.10.2

Description

Checkout the file: https://github.com/rspec/rspec-expectations/blob/main/lib/rspec/matchers/dsl.rb Go to row 304 and 305, they currently look like this:

          define_user_override(method_name, definition) do |*args, &block|
            super(*args, &block)

and accordingly to this explanation for ruby 3 they should look like

          define_user_override(method_name, definition) do |*args, **kwargs, &block|
            super(*args, **kwargs, &block)

Am I overseeing something? Thanks in advance! Best regards, Lukas

enthusiasmus avatar Jan 26 '22 20:01 enthusiasmus