Sha256: 78a6362ed362017e171c9c80e2a23ff9017332e2ecfc3774748c038bab8d4c50

Contents?: true

Size: 910 Bytes

Versions: 14

Compression:

Stored size: 910 Bytes

Contents

require 'test/unit'
require 'test/unit/testresult'
require 'test_server/runner/redgreen'
Test::Unit.run = true

module TestServer
  module Runner
    class TestUnit
      class << self
        def run(argv = ARGV, stderr = STDERR, stdout = STDOUT)
          $stdout = stdout
          $stderr = stderr
          
          # pattern = parse_opts(argv)[:pattern]
          # pattern ||= argv.first
          pattern = argv.first || 'test/**/*_test.rb'
          
          Dir[pattern].each { |file| Kernel.load file }
          
          Test::Unit::AutoRunner.run
        end
        
        protected
    
          def parse_opts(argv)
            options = { :pattern => 'test/**/*_test.rb' }
            opts = OptionParser.new do |o|
              o.on("-p", "--pattern [PATTERN]") { |p| options[:pattern] = p }
            end.parse!(argv)
            options
          end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
adva-0.3.2 test/test_server/lib/test_server/runner/test_unit.rb
adva-0.3.1 test/test_server/lib/test_server/runner/test_unit.rb
adva-0.3.0 test/test_server/lib/test_server/runner/test_unit.rb
adva-0.2.4 test/test_server/lib/test_server/runner/test_unit.rb
adva-0.2.3 test/test_server/lib/test_server/runner/test_unit.rb
adva-0.2.2 test/test_server/lib/test_server/runner/test_unit.rb
adva-0.2.1 test/test_server/lib/test_server/runner/test_unit.rb
adva-0.2.0 test/test_server/lib/test_server/runner/test_unit.rb
adva-0.1.4 test/test_server/lib/test_server/runner/test_unit.rb
adva-0.1.3 test/test_server/lib/test_server/runner/test_unit.rb
adva-0.1.2 test/test_server/lib/test_server/runner/test_unit.rb
adva-0.1.1 test/test_server/lib/test_server/runner/test_unit.rb
adva-0.1.0 test/test_server/lib/test_server/runner/test_unit.rb
adva-0.0.1 test/test_server/lib/test_server/runner/test_unit.rb