41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/minitest/tagz.rb', line 41
def run(*args)
if Tagz.run_all_if_no_match?
run_map = Runnable.runnables.reduce({}) {|memo, r| memo[r] = r.runnable_methods; memo}
should_skip_filter = run_map.all? do |ctxt, methods|
methods.all? do |m|
serialized = MinitestRunnerStrategy.serialize(ctxt, m)
tags = MinitestRunnerStrategy.tag_map[serialized]
tags.nil? ||
tags.empty? ||
((tags & Tagz.positive_tags).empty? &&
(tags & Tagz.negative_tags).empty?)
end
end
if should_skip_filter
puts "Couldn't find any runnables with the given tag, running all runnables" if Tagz.log_if_no_match?
return super
end
end
::Minitest::Test.singleton_class.class_eval { prepend(RunnableMethodsFilter) }
super
end
|