-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
25 lines (21 loc) · 724 Bytes
/
Rakefile
File metadata and controls
25 lines (21 loc) · 724 Bytes
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
desc 'Run Tests of Jasmine'
task :jasmine do
results = `java -jar ../env-js/rhino/js.jar -f test/jasmine_test.js`
if results.include?(" 0 failed in")
puts convert_html(results[/Summary<\/h2>(.*)/, 1])
puts 'Jasmine tests passed'
else
puts convert_html(results[/\<div id='fail_messages'\s*\>(.*)\<\/div\>/, 1])
raise "Jasmine tests failed"
end
end
desc 'Run jazz_hands_reporter'
task :jazzhands do
sh "java -jar ../env-js/rhino/js.jar -f test/jazz_hands_test.js" do |ok, status|
ok or fail "Jazzhands tests failed"
end
end
def convert_html(string)
return if string.nil?
string.gsub(/<[p|div]>(.*)<\/[p|div]>/) { |match| "\n\n" + $1 + "\n\n"}.gsub(/<br>/, "\n").gsub(/<[^>]+>/, '')
end