Represents anything “runnable”, like Test, Spec, Benchmark, or whatever you can dream up.
Subclasses of this are automatically registered and available in ::runnables.
Number of assertions executed in this run.
An assertion raised during the run, if any.
Responsible for running all runnable methods in a given class, each in its own instance. Each instance is passed to the reporter to record.
# File lib/minitest.rb, line 291 def self.run reporter, options = {} filter = options[:filter] || "/./" filter = Regexp.new $1 if filter =~ %r%/(.*)/% filtered_methods = self.runnable_methods.find_all { |m| filter === m || filter === "#{self}##{m}" } exclude = options[:exclude] exclude = Regexp.new $1 if exclude =~ %r%/(.*)/% filtered_methods.delete_if { |m| exclude === m || exclude === "#{self}##{m}" } 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
Runs a single method and has the reporter record the result. This was considered internal API but is factored out of run so that subclasses can specialize the running of an individual test. See Minitest::ParallelTest::ClassMethods for an example.
Each subclass of Runnable is responsible for overriding this method to return all runnable methods. See methods_matching.
Returns all subclasses of Runnable.
Was this run skipped? See passed? for more information.
© Ryan Davis, seattle.rb
Licensed under the MIT License.