Post #3128017
2026-06-01 16:58 UTC
Any #ruby #minitest users in my timeline? Today I tried to understand how to use MiniTest::Mock to expect a method call with some positional arguments, but arbitrary (none or any) keyword arguments.
I think you can’t. It's just not a thing. The only way to do this, is to use the block form with MiniTest::Mock#expect and to all argument matching yourself.
What am I missing here?
Disclaimer: I’m deep in the RSpec camp when it comes to Ruby test frameworks 🫣
Replies (1)
-
@zenspider@ruby.social 2026-06-01 18:41
@tisba@ruby.social doesn’t currently support it. For advanced mocking/stubbing look to mocha.