2009-08-27 05:13:30 +00:00
|
|
|
require 'rubygems'
|
2009-09-05 06:04:48 +00:00
|
|
|
require File.expand_path(File.join(File.dirname(__FILE__), "jasmine_helper.rb"))
|
|
|
|
require File.expand_path(File.join(JasmineHelper.jasmine_root, "contrib/ruby/jasmine_spec_builder"))
|
2009-08-27 05:13:30 +00:00
|
|
|
|
2009-12-17 01:27:06 +00:00
|
|
|
jasmine_runner = if ENV['SAUCELABS'] == 'true'
|
|
|
|
require 'sauce_tunnel'
|
|
|
|
require 'selenium_config'
|
|
|
|
Jasmine::SauceLabsRunner.new(JasmineHelper.specs,
|
|
|
|
JasmineHelper.dir_mappings,
|
|
|
|
:saucelabs_config => 'saucelabs',
|
|
|
|
:saucelabs_config_file => File.expand_path(File.join(File.dirname(__FILE__), "saucelabs.yml")))
|
|
|
|
else
|
|
|
|
require "selenium_rc"
|
2009-12-24 05:29:34 +00:00
|
|
|
Jasmine::Runner.new(SeleniumRC::Server.new('localhost').jar_path,
|
2009-12-17 01:27:06 +00:00
|
|
|
JasmineHelper.specs,
|
|
|
|
JasmineHelper.dir_mappings)
|
|
|
|
end
|
2009-08-27 05:13:30 +00:00
|
|
|
|
2009-09-05 06:04:48 +00:00
|
|
|
spec_builder = Jasmine::SpecBuilder.new(JasmineHelper.raw_spec_files, jasmine_runner)
|
2009-08-27 05:13:30 +00:00
|
|
|
|
|
|
|
should_stop = false
|
|
|
|
|
|
|
|
Spec::Runner.configure do |config|
|
|
|
|
config.after(:suite) do
|
|
|
|
spec_builder.stop if should_stop
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
spec_builder.start
|
|
|
|
should_stop = true
|
|
|
|
spec_builder.declare_suites
|