Sha256: fbacc75b761aa51cafc789aca062575d941dd5834f53d8aa02a9c22b02b1f7e7

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

#!/usr/bin/env ruby
require 'runyoufools'
require 'optparse'
require 'ostruct'

module Runyoufools

def self.main( options )
    runner = Runner.new( options )
    start = Time.now
    runner.go
    durationMinutes = "%.2f" % ( ( Time.now - start ) / 60 )
    puts "\n\n"
    say "TESTS OVER - SUMMARY".white.bold
    say_list runner.results[ :pass ]
    say_list runner.results[ :fail ]
    say "====== OVERALL ======".white.bold
    say "#{runner.message}"
    say "#{durationMinutes} minutes."

    exit( runner.success )
end

end

options = OpenStruct.new
options.pattern = /test\//
options.command = nil
options.retries = 1

parser = OptionParser.new
parser.banner = "RunYouFools! - a test runner"
parser.on "--pattern=REGEX", "-p", "Pattern (regex) for looking for test files. Defaults to 'test'" do |pattern|
    options.pattern = Regexp.new pattern
end
parser.on "--command=COMMAND", "-c", "command to preceed test file if needed, e.g. if set to 'python', RunYouFools! will use 'python test.py' instead of just 'test.py'" do |command|
    options.command = command
end
parser.on "--retries=NUMBER", '-r', 'number of retries (default: 1)' do |retries|
    options.retries = retries.to_i
end

parser.parse!
Runyoufools.main( options )

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
runyoufools-0.1.2 bin/runyoufools