File: cutest

package info (click to toggle)
ruby-cutest 1.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 176 kB
  • sloc: ruby: 376; makefile: 14
file content (21 lines) | stat: -rwxr-xr-x 479 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env ruby

if ARGV.empty?
  puts "usage: cutest [-v] [-r lib] [-o test] [-s scope] file ..."
  exit
end

require_relative "../lib/cutest"
require "clap"

files = Clap.run ARGV,
  "-r"      => lambda { |file| require file },
  "-o"      => lambda { |name| cutest[:only] = name },
  "-s"      => lambda { |name| cutest[:scope] = name },
  "-v"      => lambda { puts Cutest::VERSION; exit }

if files.any?
  success = Cutest.run(Dir[*files])

  exit(1) unless success
end