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