Integrate JasmineHelper

This commit is contained in:
ragaskar
2009-09-04 23:04:48 -07:00
parent 65cec7a2b9
commit 11f356e375
24 changed files with 202 additions and 106 deletions

View File

@@ -1,3 +1,5 @@
require File.expand_path(File.join(File.dirname(__FILE__), "spec/jasmine_helper.rb"))
namespace :test do
desc "Run continuous integration tests"
require "spec"
@@ -11,22 +13,12 @@ end
desc "Run specs via server"
task :jasmine_server do
require File.expand_path(File.join(File.dirname(__FILE__), "../../contrib/ruby/jasmine_spec_builder"))
require File.expand_path(File.join(JasmineHelper.jasmine_root, "contrib/ruby/jasmine_spec_builder"))
JASMINE_LIB = File.expand_path(File.join(File.dirname(__FILE__), '../../lib'))
dir_mappings = {
"/spec" => 'spec',
"/lib" => JASMINE_LIB
}
includes = ['lib/' + File.basename(Dir.glob("#{JASMINE_LIB}/jasmine*.js").first),
'lib/json2.js',
'lib/TrivialReporter.js']
spec_files = Dir.glob("spec/**/*[Ss]pec.js")
puts "your tests are here:"
puts "your tests are here:"
puts " http://localhost:8888/run.html"
Jasmine::SimpleServer.start(8888, includes + spec_files, dir_mappings)
Jasmine::SimpleServer.start(8888,
lambda { JasmineHelper.jasmine + JasmineHelper.spec_file_urls },
JasmineHelper.dir_mappings)
end