Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 48 lines (37 sloc) 1001 Bytes
#!/usr/bin/ruby
#
# Tryouts - Don't waste your time writing tests
#
# Usage:
#
# $ try
# $ try -q
# $ try -v
# $ try path/2/file.rb
# $ try -q path/2/file.rb path/2/another.rb
#
# Put our local lib in first place
BASE_PATH = File.expand_path File.join(File.dirname(__FILE__), '..')
lib_dir = File.join(BASE_PATH, 'lib')
$:.unshift lib_dir
require 'tryouts'
# Help out the requires in the tryouts
[File.join(Dir.pwd, 'lib'), File.join(Dir.pwd, '..', 'lib')].each do |dir|
$:.unshift dir
end
unless ARGV.delete('-V').nil?
puts "Tryouts: #{Tryouts::VERSION}"
exit
end
Tryouts.quiet = !ARGV.delete('-q').nil? # eg try -q [PATH]
Tryouts.noisy = !ARGV.delete('-v').nil? # eg try -v [PATH]
if ARGV.empty?
paths = Dir.glob(File.join(Dir.pwd, '{try,tryouts}', '*_{try,tryouts}.rb'))
paths += Dir.glob(File.join(Dir.pwd, '*_{try,tryouts}.rb'))
else
paths = ARGV
end
#Tryouts.quiet
#Tryouts.debug = true
#Tryouts.container = self
exit Tryouts.run_all(*paths)
Jump to Line
Something went wrong with that request. Please try again.