0
@@ -52,7 +52,7 @@ task :test => [:dist, :test_units]
0
require 'test/lib/jstest'
0
desc "Runs all the JavaScript unit tests and collects the results"
0
-JavaScriptTestTask.new(:test_units
) do |t|
0
+JavaScriptTestTask.new(:test_units
=> [:build_unit_tests]) do |t|
0
testcases = ENV['TESTCASES']
0
tests_to_run = ENV['TESTS'] && ENV['TESTS'].split(',')
0
browsers_to_test = ENV['BROWSERS'] && ENV['BROWSERS'].split(',')
0
@@ -62,12 +62,10 @@ JavaScriptTestTask.new(:test_units) do |t|
0
Dir.mkdir(PROTOTYPE_TMP_DIR) unless File.exist?(PROTOTYPE_TMP_DIR)
0
- Dir["test/unit/*_test.js"].each do |file|
0
- # PageBuilder.new(file, 'prototype.erb').render # TODO
0
- test_file = File.basename(file, ".js")
0
- test_name = test_file.sub("_test", "")
0
+ Dir["test/unit/tmp/*_test.html"].each do |file|
0
+ test_name = File.basename(file).sub("_test.html", "")
0
unless tests_to_run && !tests_to_run.include?(test_name)
0
- t.run("/
test/unit/tmp/#{test_file}.html", testcases)
0
+ t.run("/
#{file}", testcases)
0
@@ -76,6 +74,16 @@ JavaScriptTestTask.new(:test_units) do |t|
0
+task :build_unit_tests do
0
+ Dir[File.join('test', 'unit', '*_test.js')].each do |file|
0
+ PageBuilder.new(file, 'prototype.erb').render
0
+task :clean_package_source do
0
+ rm_rf File.join(PROTOTYPE_PKG_DIR, "prototype-#{PROTOTYPE_VERSION}")
0
desc 'Generates an empty tmp directory for building tests.'
0
puts 'Generating an empty tmp directory for building tests.'
0
@@ -103,7 +111,7 @@ namespace 'caja' do
0
desc 'Copies assets to test/unit/tmp/assets directory.'
0
- task :copy_assets => [
:dist] do
0
+ task :copy_assets => [
] do
0
puts 'Copying assets to test/unit/tmp/assets directory.'
0
assets_dir = File.join(PROTOTYPE_TMP_DIR, 'assets')
0
FileUtils.rm_rf(assets_dir) if File.exist?(assets_dir)
Comments
No one has commented yet.