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

26 lines
677 B
Ruby
Executable File

#!/usr/bin/env ruby
require 'rubygems'
require 'rainbow'
def gem_dir
File.expand_path('../..', __FILE__)
end
$:.unshift(File.join(gem_dir, 'lib'))
require 'jasmine/headless/errors'
require 'jasmine/headless/runner'
require 'jasmine/headless/options'
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