2009-11-25 06:42:15 +00:00
|
|
|
namespace :jasmine do
|
2009-12-28 18:08:23 +00:00
|
|
|
require 'jasmine'
|
2009-11-25 16:01:09 +00:00
|
|
|
helper_overrides = File.expand_path(File.join(File.dirname(__FILE__), "spec/helpers/jasmine_helper.rb"))
|
2009-11-25 06:42:15 +00:00
|
|
|
if File.exist?(helper_overrides)
|
|
|
|
require helper_overrides
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Run continuous integration tests"
|
|
|
|
require "spec"
|
|
|
|
require 'spec/rake/spectask'
|
|
|
|
Spec::Rake::SpecTask.new(:ci) do |t|
|
|
|
|
t.spec_opts = ["--color", "--format", "specdoc"]
|
2009-11-26 02:43:51 +00:00
|
|
|
t.verbose = true
|
2009-11-25 06:42:15 +00:00
|
|
|
t.spec_files = [JasmineHelper.meta_spec_path]
|
|
|
|
end
|
|
|
|
task :server do
|
|
|
|
puts "your tests are here:"
|
|
|
|
puts " http://localhost:8888/run.html"
|
|
|
|
|
2009-12-28 20:00:02 +00:00
|
|
|
Jasmine::Server.start(8888,
|
2009-11-26 03:47:05 +00:00
|
|
|
File.expand_path(Dir.pwd),
|
2009-11-25 06:42:15 +00:00
|
|
|
lambda { JasmineHelper.specs },
|
2009-11-25 16:01:09 +00:00
|
|
|
{ :spec_helpers => JasmineHelper.files + JasmineHelper.spec_helpers,
|
|
|
|
:stylesheets => JasmineHelper.stylesheets
|
|
|
|
})
|
2009-11-25 06:42:15 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Run specs via server"
|
|
|
|
task :jasmine => ['jasmine:server']
|