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

Add :any parameter for query options #1099

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nightpool
Copy link

@nightpool nightpool commented Feb 10, 2025

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

### Allow query params

```ruby
stub_request(:get, "www.example.com").with(query: :any)
Copy link
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?

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
1 participant