Skip to content

Instantly share code, notes, and snippets.

@franciscoj
Created October 9, 2019 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save franciscoj/2a560e1e6fdc9fa7a3fbd9a53ab18279 to your computer and use it in GitHub Desktop.
Save franciscoj/2a560e1e6fdc9fa7a3fbd9a53ab18279 to your computer and use it in GitHub Desktop.
# If a spec in the suite is marked with focus on the CI it will fail.
RSpec::Matchers.define :have_no_focus do
match { |ex| !ex.metadata[:focus] }
failure_message(&:inspect)
end
RSpec.configure do |config|
config.before(:each) do |example|
expect(example).to have_no_focus if ENV['CI']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment