forked from relevance/blue-ridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_jsspec.rake
More file actions
39 lines (37 loc) · 1.17 KB
/
test_jsspec.rake
File metadata and controls
39 lines (37 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
namespace :spec do
desc "Runs all the JSSpec tests and collects the results"
task :javascripts do
Dir.chdir("spec/javascripts") do
all_fine = true
files = ENV["TEST"] ? ENV["TEST"] : Dir.glob("*_spec.js").join(" ")
all_fine = false unless system("java -jar ./rhino/js.jar ./jsspec/runner.js #{files}")
raise "JSSpec test failures" unless all_fine
end
end
namespace :javascripts do
desc "Compiles all the JSSpec tests into an html file that can be run in the browser"
task :compile do
Dir.chdir("spec/javascripts") do
files = ENV["TEST"] ? ENV["TEST"] : Dir.glob("*_spec.js").join(" ")
system("java -jar ./rhino/js.jar ./jsspec/compiler.js #{files}")
end
end
end
end
# Uncomment this to add jsspec tests to your Cruise Control task
# [:test, :cruise].each do |taskname|
# task taskname do
# exceptions = ["test:jsspec"].collect do |task|
# puts "Beginning JSSpec test suite..."
# begin
# Rake::Task[task].invoke
# nil
# rescue => e
# e
# end
# end.compact
#
# exceptions.each {|e| puts e }
# raise "Test failures" unless exceptions.empty?
# end
# end