Refactor quarantine helper
By moving methods closer to where they are called.
This commit is contained in:
parent
bb6908cd5b
commit
eaba732e91
1 changed files with 8 additions and 8 deletions
|
@ -20,6 +20,14 @@ module QA::Specs::Helpers
|
|||
end
|
||||
end
|
||||
|
||||
# Skip the entire context if a context is quarantined. This avoids running
|
||||
# before blocks unnecessarily.
|
||||
def skip_or_run_quarantined_contexts(filters, example)
|
||||
return unless example.metadata.key?(:quarantine)
|
||||
|
||||
skip_or_run_quarantined_tests_or_contexts(filters, example)
|
||||
end
|
||||
|
||||
# Skip tests in quarantine unless we explicitly focus on them.
|
||||
def skip_or_run_quarantined_tests_or_contexts(filters, example)
|
||||
if filters.key?(:quarantine)
|
||||
|
@ -39,14 +47,6 @@ module QA::Specs::Helpers
|
|||
end
|
||||
end
|
||||
|
||||
# Skip the entire context if a context is quarantined. This avoids running
|
||||
# before blocks unnecessarily.
|
||||
def skip_or_run_quarantined_contexts(filters, example)
|
||||
return unless example.metadata.key?(:quarantine)
|
||||
|
||||
skip_or_run_quarantined_tests_or_contexts(filters, example)
|
||||
end
|
||||
|
||||
def filters_other_than_quarantine(filter)
|
||||
filter.reject { |key, _| key == :quarantine }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue