public
Fork of sstephenson/prototype
Description: Prototype JavaScript framework
Homepage: http://prototypejs.org/
Clone URL: git://github.com/tobie/prototype.git
Fixed Rakefile
tobie (author)
Fri Jul 11 20:42:33 -0700 2008
commit  8c20dfe1421939d9fe6926d9bb29d1b12760af19
tree    a9bf6dcbd3e0acee20ed89f9601dfc5393da1037
parent  c3edbf088d3a0fd119a8d3d1c22c3057e18d19ff
...
52
53
54
55
 
56
57
58
...
62
63
64
65
66
67
68
 
 
69
70
 
71
72
73
...
76
77
78
 
 
 
 
 
 
 
 
 
 
79
80
81
...
103
104
105
106
 
107
108
109
...
52
53
54
 
55
56
57
58
...
62
63
64
 
 
 
 
65
66
67
 
68
69
70
71
...
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
...
111
112
113
 
114
115
116
117
0
@@ -52,7 +52,7 @@ task :test => [:dist, :test_units]
0
 
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
   
0
   Dir.mkdir(PROTOTYPE_TMP_DIR) unless File.exist?(PROTOTYPE_TMP_DIR)
0
   
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
     end
0
   end
0
   
0
@@ -76,6 +74,16 @@ JavaScriptTestTask.new(:test_units) do |t|
0
   end
0
 end
0
 
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
+ end
0
+end
0
+
0
+task :clean_package_source do
0
+ rm_rf File.join(PROTOTYPE_PKG_DIR, "prototype-#{PROTOTYPE_VERSION}")
0
+end
0
+
0
 desc 'Generates an empty tmp directory for building tests.'
0
 task :clean_tmp do
0
   puts 'Generating an empty tmp directory for building tests.'
0
@@ -103,7 +111,7 @@ namespace 'caja' do
0
   end
0
   
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.