Last active
June 6, 2023 16:21
-
-
Save Lockyy/b0a143f675db5ffb6e840dc1175d44aa to your computer and use it in GitHub Desktop.
Triggers a failure automatically when a focused spec is encountered
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ENV['CI'] | |
config.before(:example, :focus) { | |
raise "You've added a focused spec to a commit, this'll prevent CI from running properly and you should remove this." | |
} | |
else | |
config.filter_run focus: true | |
config.run_all_when_everything_filtered = true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From rspec/rspec-core#1747