Class: Test::Unit::AutoRunner
- Inherits:
-
Object
- Object
- Test::Unit::AutoRunner
- Defined in:
- lib/test/unit.rb
Overview
:nodoc: all
Defined Under Namespace
Classes: Runner
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#to_run ⇒ Object
Returns the value of attribute to_run.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(force_standalone = false, default_dir = nil, argv = ARGV) ⇒ AutoRunner
constructor
A new instance of AutoRunner.
- #process_args(*args) ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(force_standalone = false, default_dir = nil, argv = ARGV) ⇒ AutoRunner
Returns a new instance of AutoRunner.
814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 |
# File 'lib/test/unit.rb', line 814 def initialize(force_standalone = false, default_dir = nil, argv = ARGV) @force_standalone = force_standalone @runner = Runner.new do |files, | [: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 if @force_standalone @options..sub!(/\[options\]/, '\& tests...') end @argv = argv end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options
812 813 814 |
# File 'lib/test/unit.rb', line 812 def @options end |
#to_run ⇒ Object
Returns the value of attribute to_run
812 813 814 |
# File 'lib/test/unit.rb', line 812 def to_run @to_run end |
Class Method Details
.run(*args) ⇒ Object
843 844 845 |
# File 'lib/test/unit.rb', line 843 def self.run(*args) new(*args).run end |
Instance Method Details
#process_args(*args) ⇒ Object
831 832 833 834 |
# File 'lib/test/unit.rb', line 831 def process_args(*args) @runner.process_args(*args) !@to_run.empty? end |
#run ⇒ Object
836 837 838 839 840 841 |
# File 'lib/test/unit.rb', line 836 def run if @force_standalone and not process_args(@argv) abort @options. end @runner.run(@argv) || true end |