Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PUP-11456) Avoid ruby kwarg and hash confusion with doubles #8879

Merged
merged 1 commit into from
Feb 22, 2022

Conversation

joshcooper
Copy link
Contributor

Previously the test failed on ruby 3.0.3 and rspec 3.10.3 due to expecting a
method to be called with keyword arguments, but getting called with a hash.
The issue is described in [1], but the problem stems from using a "double" since
rspec has no way of knowing whether the "real" object accepts keyword args or a
hash. This commit avoids the issue entirely by using a real object.

[1] rspec/rspec-mocks#1460

Previously the test failed on ruby 3.0.3 and rspec 3.10.3 due to expecting a
method to be called with keyword arguments, but getting called with a hash.
The issue is described in [1], but the problem stems from using a "double" since
rspec has no way of knowing whether the "real" object accepts keyword args or a
hash. This commit avoids the issue entirely by using a real object.

[1] rspec/rspec-mocks#1460
@mhashizume mhashizume merged commit d2ae297 into puppetlabs:main Feb 22, 2022
@joshcooper joshcooper deleted the rspec_ruby3_11456 branch February 22, 2022 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants