Created
June 7, 2016 19:30
-
-
Save myronmarston/aacdd20b940ed641dea0cd8ab7777e3d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
RSpec.configure do |config| | |
# Either put conditional logic in the hook... | |
config.around(:example) do |ex| | |
unless ex.metadata[:slow] | |
puts "Not tagged slow" | |
end | |
ex.run | |
end | |
# ...or auto-tag everything with `slow: false` in a way that | |
# individual groups/examples can override: | |
config.define_derived_metadata do |meta| | |
meta[:slow] = false unless meta.key?(:slow) | |
end | |
# ...and then filter on `slow: false`: | |
config.around(:example, slow: false) do |ex| | |
puts "Not tagged slow" | |
ex.run | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment