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 strict_mode to Test::Stubs #1298

Merged
merged 5 commits into from Aug 1, 2021
Merged

Add strict_mode to Test::Stubs #1298

merged 5 commits into from Aug 1, 2021

Conversation

yykamei
Copy link
Contributor

@yykamei yykamei commented Aug 1, 2021

Description

Close #1291

Sometimes, users might want to check whether stubbed requests exactly
match the parameters and headers. In this case, they expect
Test::Stubs to raise an error when they add a new parameter in a
request. This patch introduces strict_mode for the purpose of the
expectation. With strict_mode, Test::Stubs tries to check all a
path, parameters, and headers exactly.

Todos

  • Tests
  • Documentation

Sometimes, users might want to check whether stubbed requests exactly
match the parameters and headers. In this case, they expect
`Test::Stubs` to raise an error when they add a new parameter in a
request. This patch introduces `strict_mode` for the purpose of the
expectation. With `strict_mode`, `Test::Stubs` tries to check all a
path, parameters, and headers exactly.
* Update UPGRADING.md to highlight adapters being moved out
* Cleanup tests
* Cleanup Gemfile
* Update CI
This reverts commit ed527e5, reversing
changes made to 13c0fcf.
@iMacTia iMacTia mentioned this pull request Aug 1, 2021
2 tasks
@iMacTia iMacTia changed the base branch from main to 1.x August 1, 2021 16:42
Copy link
Member

@iMacTia iMacTia left a comment

Choose a reason for hiding this comment

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

Nice work implementing this and great test coverage!
Apologies about the mess with commits, but we recently started the works on Faraday v2.0 and I got confused 😅. I've reverted those changes and changed the base branch to the correct one (1.x) 👍.

LGTM 🎉 !

@iMacTia iMacTia merged commit a1ee375 into lostisland:1.x Aug 1, 2021
@yykamei
Copy link
Contributor Author

yykamei commented Aug 1, 2021

Oh, thank you! I should have opened a PR into 1.x 😅
Anyway, thank you for reviewing so quickly!

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.

Feature request: how about making verify_stubbed_calls verify the parameters of stubbed requests?
2 participants