class L::Test::TargetTest

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/rub/l/test.rb, line 162
def initialize
        super()
        
        register
end

Public Instance Methods

build_self() click to toggle source
# File lib/rub/l/test.rb, line 176
def build_self
        out = StringIO.new("", "w")

        options = {
                io:      out,
                verbose: true
        }

        reporter = Minitest::CompositeReporter.new
        reporter << Minitest::SummaryReporter.new(options[:io], options)
        
        reporter.start
        out.string = '' # We don't want the start text.
        
        run_tests reporter, options
        reporter.report
        
        bs = R::BuildStep.new
        bs.desc = "Test Results"
        bs.status = reporter.passed? ? 0 : 1
        bs.out = out.string
        bs.print
end
input() click to toggle source
# File lib/rub/l/test.rb, line 150
def input
        Minitest::Runnable.runnables.map do |r|
                r.rub_target
        end.compact.map do |t|
                t.input.to_a
        end.flatten.to_set
end
output() click to toggle source
# File lib/rub/l/test.rb, line 158
def output
        Set[:test]
end
run_tests(reporter, options) click to toggle source
# File lib/rub/l/test.rb, line 168
def run_tests(reporter, options)
        Minitest::Runnable.runnables.each do |r|
                r.rub_target or next
                
                r.rub_target.run_tests reporter, options
        end
end