-
Notifications
You must be signed in to change notification settings - Fork 46
/
test_jsspec.rake
36 lines (34 loc) · 1.01 KB
/
test_jsspec.rake
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
# Replace the path to js.jar with something that works in your environment
namespace :test do
desc "Runs all the JSSpec tests and collects the results"
task :jsspec do
Dir.chdir("test/javascripts") do
all_fine = true
if ENV["TEST"]
all_fine = false unless system("java -jar ~/TOOLS/rhino1_7R1/js.jar #{ENV["TEST"]}")
else
Dir.glob("spec*.js").each do |file|
all_fine = false unless system("java -jar ~/TOOLS/rhino1_7R1/js.jar #{file}")
end
end
raise "JSSpec test failures" unless all_fine
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