Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent unrelated exceptions by requiring
rails_helper
at .rspec
When there is a bug in the code on the load, RSpec catches the exception, aborts the spec file, proceeds to the following spec file, and retries `require` with partially loaded Rails application. In some cases, we see many identical errors, such as `NameError`, which are noisy but help developers find the bug. In other cases, due to retrying `require`, we see many unrelated errors like `FrozenError`, which flood the result and flush out the original cause at the top. The following comment describes this issue in detail. thoughtbot/factory_bot_rails#303 (comment) This patch prevents unrelated exceptions by the fail-fast feature of rspec/core. rspec/rspec-core#2568
- Loading branch information