You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
expect_request should take into account times() #1108
When you pass a stub to assert_requested, it's just being used as a request pattern, not as an expectation count. It's just a convenience support for RequestStub parameter.
Activity
[-]expect_request should take into account `times`[/-][+]expect_request should take into account `times()`[/+]bblimke commentedon Oct 30, 2025
@grosser Thanks for the suggestion!
However,
timesonRequestStubserves a different purpose, it defines how many times a response should be returned before moving to the next declared response. It's not meant to specify how many times the request matching this stub is expected to be made. Please see: https://github.com/bblimke/webmock/?tab=readme-ov-file#specifying-number-of-times-given-response-should-be-returnedWhen you pass a stub to
assert_requested, it's just being used as a request pattern, not as an expectation count. It's just a convenience support for RequestStub parameter.Have you tried this instead?