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

docs: Stop suggest calling stub_with at compilation time #134

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

jtomaszewski
Copy link
Contributor

The docs are still slightly suggesting that stub_with can be used just as defmock function in the test_helper.exs file, which is not true. #122 was not enough to prevent devs from doing that mistake again.

Moreover, if a developer does it, the stub_with call in the test helper won't raise any error (even though it has no effect); only later on in the test files they will meet unhelpful errors like no expectation defined for ..., making the root cause hard to discover.

Let's help avoiding it.

The docs are still slightly suggesting that `stub_with` can be used just as `defmock` function in the `test_helper.exs` file, which is not true. dashbitco#122 was not enough to prevent devs from doing that mistake again.

Moreover, if a developer does it, the `stub_with` call in the test helper won't raise any error (even though it has no effect); only later on in the test files they will meet unhelpful errors like `no expectation defined for ...`, making the root cause hard to discover.

Let's help avoiding it.
@josevalim josevalim merged commit be4c612 into dashbitco:master Feb 7, 2023
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@anthonator anthonator mentioned this pull request Sep 20, 2023
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.

2 participants