Refactor quarantine helper

By moving methods closer to where they are called.
This commit is contained in:
Walmyr Lima 2019-04-26 18:33:41 +02:00
parent bb6908cd5b
commit eaba732e91

View file

@ -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