You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have an exit() in a library file, and you unit test that library file, the exit will exit out of rspec and silently not run tests (and be a "green" build if exit code is 0 and depending on your test suite).
If you write a ruby processor outside of the rails controller context, the program will exit and stop running which is probably not desirable if part of your web stack (you instead want to continue running your web app).
This may be enough of an edge case to ignore, but figured I'd recommend.
Expected behavior
A rubocop warning of some sort if I try to use an exit() in rails apps.
Actual behavior
No warning.
The text was updated successfully, but these errors were encountered:
I ran into this recently which is what prompted this. I couldn't find an existing cop, so figured I'd suggest it and if it is welcomed open a PR.
Generally speaking, exit calls in a rails app are probably not wanted. Rails seems to rescue from SystemExit by default (testing on my own app + code at https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/metal/rescue.rb), but there a few reasons it's still probably not the functionality desired:
This may be enough of an edge case to ignore, but figured I'd recommend.
Expected behavior
A rubocop warning of some sort if I try to use an exit() in rails apps.
Actual behavior
No warning.
The text was updated successfully, but these errors were encountered: