Skip to content

Instantly share code, notes, and snippets.

@marzdrel
Last active November 12, 2021 11:31
Show Gist options
  • Save marzdrel/b07b247b7a45d4481ddc850b796a7758 to your computer and use it in GitHub Desktop.
Save marzdrel/b07b247b7a45d4481ddc850b796a7758 to your computer and use it in GitHub Desktop.
Make sure CI fails if any of the spec examples are tagged with :focus
# spec/rails_helper.rb
RSpec.configure do |config|
if ENV["CI"]
config.before(:example, :focus) { raise "Should not commit focused specs" }
else
config.filter_run focus: true
config.run_all_when_everything_filtered = true
end
# [...]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment