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

Use ActiveSupport::TestCases setup and teardown hooks #1626

Closed
kaspth opened this issue Jul 22, 2024 · 0 comments · Fixed by #1737
Closed

Use ActiveSupport::TestCases setup and teardown hooks #1626

kaspth opened this issue Jul 22, 2024 · 0 comments · Fixed by #1737

Comments

@kaspth
Copy link
Contributor

kaspth commented Jul 22, 2024

Looks like Bullet Train is using minitest's def setup and def teardown where users must remember to call super manually.

ActiveSupport::TestCase includes setup do (or setup :some_setup_method) and teardown do where users won't need to remember that detail.

I think we should swap to the more Rails conventional version.

References:
https://github.com/search?q=repo%3Abullet-train-co%2Fbullet_train%20%2Fdef%20setup%2F&type=code
https://github.com/search?q=repo%3Abullet-train-co%2Fbullet_train+%2Fdef+teardown%2F&type=code

cc @jagthedrummer

jagthedrummer added a commit to bullet-train-co/bullet_train-core that referenced this issue Nov 1, 2024
When using `def setup` things can behave unpredictably if developers
forget to call `super`. Using the `setup do` callback form eliminates
that problem.

Partial fix for: bullet-train-co/bullet_train#1626
jagthedrummer added a commit that referenced this issue Nov 1, 2024
When using `def setup` things can behave unpredictably if developers forget to call `super`. Using the `setup do` callback form eliminates that problem.

Fixes: #1626
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 a pull request may close this issue.

1 participant