debian-mirror-gitlab/spec/support/helpers/gitlab_verify_helpers.rb

26 lines
475 B
Ruby
Raw Normal View History

2018-10-15 14:42:47 +05:30
module GitlabVerifyHelpers
def collect_ranges(args = {})
verifier = described_class.new(args.merge(batch_size: 1))
collect_results(verifier).map { |range, _| range }
end
def collect_failures
verifier = described_class.new(batch_size: 1)
out = {}
collect_results(verifier).map { |_, failures| out.merge!(failures) }
out
end
def collect_results(verifier)
out = []
verifier.run_batches { |*args| out << args }
out
end
end