module Minitest::Tagz::MinitestPatch
Public Instance Methods
run(*args)
click to toggle source
Calls superclass method
# File lib/minitest/tagz/minitest_patch.rb, line 4 def run(*args) # Check for no match and don't filter runnable methods if there would be no match if Tagz.run_all_if_no_match? run_map = Minitest::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 = Tagz.serialize(ctxt, m) tags = Tagz.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(MinitestPatch::RunnableMethodsPatch) } super end