class Minitest::Runnable
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/minitest.rbs class Minitest::Runnable def self.runnables: () -> untyped end
def self.inherited klass # :nodoc:
re-open
def self.inherited klass # :nodoc: self.runnables << klass super end
def self.methods_matching re
def self.methods_matching re public_instance_methods(true).grep(re).map(&:to_s) end
def self.on_signal name, action # :nodoc:
def self.on_signal name, action # :nodoc: supported = SIGNALS[name] old_trap = trap name do old_trap.call if old_trap.respond_to? :call action.call end if supported yield ensure trap name, old_trap if supported end
def self.reset # :nodoc:
def self.reset # :nodoc: @@runnables = [] end
def self.run reporter, options = {}
def self.run reporter, options = {} filtered_methods = if options[:filter] filter = options[:filter] filter = Regexp.new $1 if filter.is_a?(String) && filter =~ %r%/(.*)/% self.runnable_methods.find_all { |m| filter === m || filter === "#{self}##{m}" } else self.runnable_methods end if options[:exclude] exclude = options[:exclude] exclude = Regexp.new $1 if exclude =~ %r%/(.*)/% filtered_methods.delete_if { |m| exclude === m || exclude === "#{self}##{m}" } end return if filtered_methods.empty? with_info_handler reporter do filtered_methods.each do |method_name| run_one_method self, method_name, reporter end end end
def self.run_one_method klass, method_name, reporter
def self.run_one_method klass, method_name, reporter reporter.prerecord klass, method_name reporter.record Minitest.run_one_method(klass, method_name) end
def self.runnable_methods
def self.runnable_methods raise NotImplementedError, "subclass responsibility" end
def self.runnables
Experimental RBS support (using type sampling data from the type_fusion
project).
def self.runnables: () -> untyped
This signature was generated using 4 samples from 1 application.
def self.runnables @@runnables end
def self.test_order
def self.test_order :random end
def self.with_info_handler reporter, &block # :nodoc:
def self.with_info_handler reporter, &block # :nodoc: handler = lambda do unless reporter.passed? then warn "Current results:" warn "" warn reporter.reporters.first warn "" end end on_signal ::Minitest.info_signal, handler, &block end
def failure # :nodoc:
def failure # :nodoc: self.failures.first end
def initialize name # :nodoc:
def initialize name # :nodoc: self.name = name self.failures = [] self.assertions = 0 # lazy initializer for metadata end
def marshal_dump # :nodoc:
def marshal_dump # :nodoc: unless @@marshal_dump_warned then warn ["Minitest::Runnable#marshal_dump is deprecated.", "You might be violating internals. From", caller.first].join " " @@marshal_dump_warned = true end [self.name, self.failures, self.assertions, self.time] end
def marshal_load ary # :nodoc:
def marshal_load ary # :nodoc: self.name, self.failures, self.assertions, self.time = ary end
def metadata
def metadata @metadata ||= {} end
def metadata?
def metadata? defined? @metadata end
def name
def name @NAME end
def name= o
def name= o @NAME = o end
def passed?
def passed? raise NotImplementedError, "subclass responsibility" end
def result_code
def result_code raise NotImplementedError, "subclass responsibility" end
def run
def run raise NotImplementedError, "subclass responsibility" end
def skipped?
def skipped? raise NotImplementedError, "subclass responsibility" end
def time_it # :nodoc:
def time_it # :nodoc: t0 = Minitest.clock_time yield ensure self.time = Minitest.clock_time - t0 end