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

26 lines
677 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'))
require 'jasmine/headless/errors'
require 'jasmine/headless/runner'
require 'jasmine/headless/options'
2011-05-06 18:05:15 +00:00
begin
puts "Running Jasmine specs...".color(:white)
exit Jasmine::Headless::Runner.run(Jasmine::Headless::Options.from_command_line)
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