Keyword argument warning on Ruby 2.7 for #and_call_original
Created by: jaynetics
Subject of the issue
#and_call_original
with keyword arguments causes the following warning:
~/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/message_expectation.rb:101: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
Your environment
- Ruby version: 2.7.0
- rspec-expectations version: 3.9.0
Steps to reproduce
require 'rspec'
class Foo
def initialize(bar: nil); end
end
RSpec.describe Foo do
it 'works' do
expect(Foo).to receive(:new).with(bar: :qux).and_call_original
Foo.new(bar: :qux)
end
end
RSpec::ExampleGroups::Foo.run
Expected behavior
No warning is emitted.
Actual behavior
A warning is emitted.