Class: Test::Unit::AutoRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/test/unit.rb

Defined Under Namespace

Classes: Runner

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(force_standalone = false, default_dir = nil, argv = ARGV) ⇒ AutoRunner

Returns a new instance of AutoRunner



611
612
613
614
615
616
617
618
619
620
621
622
# File 'lib/test/unit.rb', line 611

def initialize(force_standalone = false, default_dir = nil, argv = ARGV)
  @runner = Runner.new do |files, options|
    options[:base_directory] ||= default_dir
    files << default_dir if files.empty? and default_dir
    @to_run = files
    yield self if block_given?
    files
  end
  Runner.runner = @runner
  @options = @runner.option_parser
  @argv = argv
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options



609
610
611
# File 'lib/test/unit.rb', line 609

def options
  @options
end

#to_runObject

Returns the value of attribute to_run



609
610
611
# File 'lib/test/unit.rb', line 609

def to_run
  @to_run
end

Class Method Details

.run(*args) ⇒ Object



633
634
635
# File 'lib/test/unit.rb', line 633

def self.run(*args)
  new(*args).run
end

Instance Method Details

#process_args(*args) ⇒ Object



624
625
626
627
# File 'lib/test/unit.rb', line 624

def process_args(*args)
  @runner.process_args(*args)
  !@to_run.empty?
end

#runObject



629
630
631
# File 'lib/test/unit.rb', line 629

def run
  @runner.run(@argv) || true
end