module RSpec::Support::WithKeywordsWhenNeeded

Public Instance Methods

Remove this in RSpec 4 in favour of explicitly passed in kwargs where this is used. Works around a warning in Ruby 2.7

# File rspec-support/lib/rspec/support/with_keywords_when_needed.rb, line 15
def class_exec(klass, *args, &block)
  if MethodSignature.new(block).has_kw_args_in?(args)
    kwargs = args.pop
    klass.class_exec(*args, **kwargs, &block)
  else
    klass.class_exec(*args, &block)
  end
end