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

Fix hash vs keyword arguments in RSpec expectations (bsc#1204871) #584

Merged
merged 2 commits into from
Oct 31, 2022

Conversation

mvidner
Copy link
Member

@mvidner mvidner commented Oct 31, 2022

Problem

New rspec-mocks distinguish between hash and keyword arguments passed to with.

The tested code does use hashes but we've used keywords in tests because
it's shorter to write. Fixed.

rspec-mocks 3.11.2 / 2022-10-25:

Bug Fixes: Support keyword argument semantics when constraining argument
expectations using with on Ruby 3.0+ with instance_double
rspec/rspec-mocks#1473

Solution

Use hashes in tests instead of keywords

Testing

  • Red-green tested with manually installed rspec 3.12.0

Screenshots

Not affected

New rspec-mocks distinguish between hash and keyword arguments passed to `with`.

The tested code does use hashes but we've used keywords in tests because
it's shorter to write. Fixed.

rspec-mocks 3.11.2 / 2022-10-25:

> Bug Fixes: Support keyword argument semantics when constraining argument
> expectations using with on Ruby 3.0+ with instance_double
> rspec/rspec-mocks#1473
@coveralls
Copy link

coveralls commented Oct 31, 2022

Coverage Status

Coverage remained the same at 84.166% when pulling 5b52161 on rspec-kw-hash into 0fb5897 on master.

expect(SUSE::Connect::YaST).to receive(:write_config).with(
url: url,
insecure: false
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, I am not sure if old form is wrong as it is one of ruby feature to auto convert hash if it is only argument. But maybe lost with ruby3?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yast-bot
Copy link
Contributor

✔️ Public Jenkins job #156 successfully finished
✔️ Created OBS submit request #1032491

@yast-bot
Copy link
Contributor

✔️ Internal Jenkins job #112 successfully finished
✔️ Created IBS submit request #283440

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

4 participants