jasmine-headless-webkit/bin/jasmine-headless-webkit

39 lines
929 B
Plaintext
Raw Normal View History

2011-04-11 10:38:47 +00:00
#!/usr/bin/env ruby
2011-05-10 13:25:55 +00:00
require 'rubygems'
require 'rainbow'
2011-05-10 13:25:55 +00:00
2011-05-29 16:30:19 +00:00
def gem_dir
File.expand_path('../..', __FILE__)
end
2011-05-06 18:05:15 +00:00
$:.unshift(File.join(gem_dir, 'lib'))
2011-09-01 14:39:29 +00:00
require 'jasmine-headless-webkit'
require 'jasmine/headless/errors'
require 'jasmine/headless/runner'
require 'jasmine/headless/options'
2011-05-06 18:05:15 +00:00
begin
2011-08-22 17:26:48 +00:00
options = Jasmine::Headless::Options.from_command_line
runner = Jasmine::Headless::Runner.new(options)
if options[:do_list]
files_list = Jasmine::FilesList.new(
:config => runner.jasmine_config
)
files_list.files.each { |file| puts file }
else
puts "Running Jasmine specs...".color(:white)
exit runner.run
end
rescue CoffeeScript::CompilationError
exit 1
rescue StandardError => e
$stderr.puts "[%s] %s (%s)" % [ "jasmine-headless-webkit".color(:red), e.message.color(:white), e.class.name.color(:yellow) ]
$stderr.puts e.backtrace.collect { |line| " #{line}" }.join("\n")
exit 1
end
2011-04-11 10:38:47 +00:00