However, the problem still seems to be there in cases of rspec-mocks config verify_partial_doubles = true.
Below standalone example passes with ruby 3.1.3, fails with ruby 3.2.0. I expect it to pass with both.
(This is of course isolated into a reproduction case from an actual codebase with more going on)
In both cases rspec 3.12.0, rspec-mocks 3.12.1.
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
gem "rspec", "3.12.0" # Activate the gem and version you are reporting the issue against.
gem "rspec-mocks", "3.12.1"
end
puts "Ruby version is: #{RUBY_VERSION}"
require 'rspec/autorun'
RSpec.configure do |config|
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
end
class MyClass
def my_method(**options)
puts options
end
end
RSpec.describe 'allow to receive' do
it 'can receive kw args in block' do
obj = MyClass.new
allow(obj).to receive(:my_method) do |**args|
expect(args[:foo]).to eq "bar"
"value"
end
obj.my_method(foo: "bar")
end
end
Without mocks.verify_partial_doubles = true, passes in both ruby 3.1 and 3.2. I think the fix in #1508 is somehow ineffective in cases of mocks.verify_partial_doubles = true?
I noticed #1508, released in rspec-mocks 3.12.1.
However, the problem still seems to be there in cases of rspec-mocks config
verify_partial_doubles = true
.Below standalone example passes with ruby 3.1.3, fails with ruby 3.2.0. I expect it to pass with both.
(This is of course isolated into a reproduction case from an actual codebase with more going on)
In both cases rspec 3.12.0, rspec-mocks 3.12.1.
Without
mocks.verify_partial_doubles = true
, passes in both ruby 3.1 and 3.2. I think the fix in #1508 is somehow ineffective in cases ofmocks.verify_partial_doubles = true
?