2009-09-05 06:04:48 +00:00
|
|
|
require File.expand_path(File.join(File.dirname(__FILE__), "spec/jasmine_helper.rb"))
|
|
|
|
|
2009-08-27 05:13:30 +00:00
|
|
|
namespace :test do
|
|
|
|
desc "Run continuous integration tests"
|
2009-12-17 01:27:06 +00:00
|
|
|
task :ci => :'ci:local'
|
|
|
|
namespace :ci do
|
|
|
|
require "spec"
|
|
|
|
require 'spec/rake/spectask'
|
2009-08-27 05:13:30 +00:00
|
|
|
|
2009-12-17 01:27:06 +00:00
|
|
|
Spec::Rake::SpecTask.new(:local) do |t|
|
|
|
|
t.spec_opts = ["--color", "--format", "specdoc"]
|
|
|
|
t.spec_files = ["spec/jasmine_spec.rb"]
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Run continuous integration tests using Sauce Labs 'Selenium in the Cloud'"
|
|
|
|
task :saucelabs do
|
|
|
|
ENV['SAUCELABS'] = 'true'
|
|
|
|
Rake::Task['test:ci:local'].invoke
|
|
|
|
end
|
2009-08-27 05:13:30 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Run specs via server"
|
|
|
|
task :jasmine_server do
|
2009-09-05 06:04:48 +00:00
|
|
|
require File.expand_path(File.join(JasmineHelper.jasmine_root, "contrib/ruby/jasmine_spec_builder"))
|
2009-08-27 05:13:30 +00:00
|
|
|
|
|
|
|
puts "your tests are here:"
|
|
|
|
puts " http://localhost:8888/run.html"
|
|
|
|
|
2009-09-05 06:04:48 +00:00
|
|
|
Jasmine::SimpleServer.start(8888,
|
2009-11-01 04:47:11 +00:00
|
|
|
lambda { JasmineHelper.specs },
|
2009-09-05 06:04:48 +00:00
|
|
|
JasmineHelper.dir_mappings)
|
2009-08-27 05:13:30 +00:00
|
|
|
end
|