2011-04-11 10:38:47 +00:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
|
2011-05-10 13:25:55 +00:00
|
|
|
require 'rubygems'
|
2011-06-19 19:08:18 +00:00
|
|
|
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-06-19 19:08:18 +00:00
|
|
|
require 'jasmine/headless/errors'
|
|
|
|
require 'jasmine/headless/runner'
|
|
|
|
require 'jasmine/headless/options'
|
2011-05-06 18:05:15 +00:00
|
|
|
|
2011-06-17 14:27:00 +00:00
|
|
|
begin
|
2011-06-19 19:08:18 +00:00
|
|
|
puts "Running Jasmine specs...".color(:white)
|
|
|
|
exit Jasmine::Headless::Runner.run(Jasmine::Headless::Options.from_command_line)
|
|
|
|
rescue CoffeeScript::CompilationError
|
|
|
|
exit 1
|
2011-06-17 14:27:00 +00:00
|
|
|
rescue StandardError => e
|
2011-06-19 19:08:18 +00:00
|
|
|
$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")
|
2011-06-17 14:27:00 +00:00
|
|
|
exit 1
|
|
|
|
end
|
2011-04-11 10:38:47 +00:00
|
|
|
|