Sha256: d74b6e3a2fe0f1ab3b0ee068abb73c363b9fb99bda8e5d495b7faa41ec9291bb

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 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 = nil
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." 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!
if options.pattern == nil
    puts "ERROR: Must specify pattern. Please use --help"
    exit false
end
Runyoufools.main( options )

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
runyoufools-0.1.4 bin/runyoufools
runyoufools-0.1.3 bin/runyoufools