2009-11-25 06:42:15 +00:00
|
|
|
require 'rubygems'
|
|
|
|
require "selenium_rc"
|
|
|
|
require File.expand_path(File.join(File.dirname(__FILE__), "jasmine_helper.rb"))
|
2009-11-26 02:47:22 +00:00
|
|
|
helper_overrides = File.expand_path(File.join(Dir.pwd, "spec", "helpers", "jasmine_helper.rb"))
|
|
|
|
if File.exist?(helper_overrides)
|
|
|
|
require helper_overrides
|
|
|
|
end
|
2009-11-26 02:43:51 +00:00
|
|
|
require File.expand_path(File.join(File.dirname(__FILE__), "jasmine_runner.rb"))
|
|
|
|
require File.expand_path(File.join(File.dirname(__FILE__), "jasmine_spec_builder"))
|
2009-11-25 06:42:15 +00:00
|
|
|
|
|
|
|
jasmine_runner = Jasmine::Runner.new(SeleniumRC::Server.new.jar_path,
|
2009-11-26 02:43:51 +00:00
|
|
|
Dir.pwd,
|
2009-11-25 06:42:15 +00:00
|
|
|
JasmineHelper.specs,
|
2009-11-25 16:01:09 +00:00
|
|
|
{ :spec_helpers => JasmineHelper.files + JasmineHelper.spec_helpers,
|
2009-11-26 02:47:22 +00:00
|
|
|
:stylesheets => JasmineHelper.stylesheets
|
|
|
|
})
|
2009-11-25 06:42:15 +00:00
|
|
|
|
|
|
|
spec_builder = Jasmine::SpecBuilder.new(JasmineHelper.spec_files, jasmine_runner)
|
|
|
|
|
|
|
|
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
|