Skip to content

Add :any parameter for query options - #1099

Merged
bblimke merged 1 commit into
bblimke:masterfrom
nightpool:add-any-query-option
Oct 14, 2026
Merged

bblimke merged 1 commit into
bblimke:masterfrom
nightpool:add-any-query-option

Conversation

@nightpool

@nightpool nightpool commented Feb 10, 2025 •

Copy link
Copy Markdown
Contributor

Implements and closes #877!

Implementation was very straightforward, the only doubt I had was the first parameter to AnyArgMatcher. I'm not sure if the nil argument is necessary, since we explicitly ignore it. Feels like it would be better to make initialize allow a default value of nil. However, all of the existing usages of AnyArgMatcher also pass nil, so I held off on making that change for now to get some feedback on whether that change makes sense

Comment thread README.md
### Allow query params

```ruby
stub_request(:get, "www.example.com").with(query: :any)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Even this usage still feels a little heavy-weight to me.... Is there any reason we can't do stub_request(:get, "www.example.com", query: :any)? Or even just make it the default?

@bblimke
bblimke merged commit 0b56b62 into bblimke:master Oct 14, 2026
@bblimke

bblimke commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Thank you @nightpool

I added a few things after merging.

It will be included in the next release.

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.

Stubbing a request with any query

2 participants