diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-12 18:13:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-12 18:13:54 +0300 |
commit | 462b603802e45891ac5152aea8cbc9298d7d4a53 (patch) | |
tree | de7e03460744491c0d7dcc6e3340272f833fb3b7 /spec/support/system_exit_detected.rb | |
parent | da646aac6c559584f63d1fc06132d7351abcfac6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/system_exit_detected.rb')
-rw-r--r-- | spec/support/system_exit_detected.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/support/system_exit_detected.rb b/spec/support/system_exit_detected.rb new file mode 100644 index 00000000000..86c6af3ba8c --- /dev/null +++ b/spec/support/system_exit_detected.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +SystemExitDetected = Class.new(RuntimeError) + +RSpec.configure do |config| + config.around do |example| + example.run + rescue SystemExit + # In any cases, we cannot raise SystemExit in the tests, + # because it'll skip any following tests from running. + # Convert it to something that won't skip everything. + # See https://gitlab.com/gitlab-org/gitlab/-/issues/350060 + raise SystemExitDetected, "SystemExit should be rescued in the tests!" + end +end |