Skip to content

feat(test): add Stubs#clear to remove all stubs#1675

Merged
olleolleolle merged 1 commit into
lostisland:mainfrom
SAY-5:feat-stubs-clear
May 19, 2026
Merged

feat(test): add Stubs#clear to remove all stubs#1675
olleolleolle merged 1 commit into
lostisland:mainfrom
SAY-5:feat-stubs-clear

Conversation

@SAY-5
Copy link
Copy Markdown
Contributor

@SAY-5 SAY-5 commented May 19, 2026

Description

Adds a clear method to Faraday::Adapter::Test::Stubs that removes all stubs, including consumed ones, so the test adapter can be reset between examples without the Faraday.default_connection = nil hack. Docs updated to suggest it. Closes #1570, as @iMacTia agreed in the issue ("I'd be open to introducing a clear method on Faraday::Adapter::Test::Stubs").

Todos

  • Tests
  • Documentation

Additional Notes

None.

Copy link
Copy Markdown
Member

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

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

Thank you, @SAY-5, this clarifies!

@olleolleolle olleolleolle merged commit 59334e0 into lostisland:main May 19, 2026
9 checks passed
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.

Would you be open to me contributing a #clear method in Faraday::Adapter::Test::Stubs?

2 participants