<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitmodules</filename>
    </added>
    <added>
      <filename>test/unit/templates/default.erb</filename>
    </added>
    <added>
      <filename>vendor/unittest_js</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -45,6 +45,9 @@ From the root Prototype directory,
 
 Check out the Prototype source with 
   $ git clone git://github.com/sstephenson/prototype.git
+  $ cd prototype
+  $ git submodule init
+  $ git submodule update
 
 Find out how to contribute:
   http://prototypejs.org/contribute</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -1,13 +1,14 @@
 require 'rake'
 require 'rake/packagetask'
 
-PROTOTYPE_ROOT     = File.expand_path(File.dirname(__FILE__))
-PROTOTYPE_SRC_DIR  = File.join(PROTOTYPE_ROOT, 'src')
-PROTOTYPE_DIST_DIR = File.join(PROTOTYPE_ROOT, 'dist')
-PROTOTYPE_PKG_DIR  = File.join(PROTOTYPE_ROOT, 'pkg')
-PROTOTYPE_TEST_DIR = File.join(PROTOTYPE_ROOT, 'test')
-PROTOTYPE_TMP_DIR  = File.join(PROTOTYPE_TEST_DIR, 'unit', 'tmp')
-PROTOTYPE_VERSION  = '1.6.0.3'
+PROTOTYPE_ROOT          = File.expand_path(File.dirname(__FILE__))
+PROTOTYPE_SRC_DIR       = File.join(PROTOTYPE_ROOT, 'src')
+PROTOTYPE_DIST_DIR      = File.join(PROTOTYPE_ROOT, 'dist')
+PROTOTYPE_PKG_DIR       = File.join(PROTOTYPE_ROOT, 'pkg')
+PROTOTYPE_TEST_DIR      = File.join(PROTOTYPE_ROOT, 'test')
+PROTOTYPE_TEST_UNIT_DIR = File.join(PROTOTYPE_TEST_DIR, 'unit')
+PROTOTYPE_TMP_DIR       = File.join(PROTOTYPE_TEST_UNIT_DIR, 'tmp')
+PROTOTYPE_VERSION       = '1.6.0.3'
 
 task :default =&gt; [:dist, :dist_helper, :package, :clean_package_source]
 
@@ -47,46 +48,71 @@ Rake::PackageTask.new('prototype', PROTOTYPE_VERSION) do |package|
   )
 end
 
-desc &quot;Builds the distribution and the test suite, runs the tests and collects their results.&quot;
-task :test =&gt; [:dist, :test_units]
+task :clean_package_source do
+  rm_rf File.join(PROTOTYPE_PKG_DIR, &quot;prototype-#{PROTOTYPE_VERSION}&quot;)
+end
 
-require 'test/lib/jstest'
-desc &quot;Runs all the JavaScript unit tests and collects the results&quot;
-JavaScriptTestTask.new(:test_units =&gt; [:build_unit_tests]) do |t|
-  testcases        = ENV['TESTCASES']
-  tests_to_run     = ENV['TESTS']    &amp;&amp; ENV['TESTS'].split(',')
-  browsers_to_test = ENV['BROWSERS'] &amp;&amp; ENV['BROWSERS'].split(',')
-  
-  t.mount(&quot;/dist&quot;)
-  t.mount(&quot;/test&quot;)
+task :test =&gt; ['test:build', 'test:run']
+namespace :test do
+  desc 'Runs all the JavaScript unit tests and collects the results'
+  task :run =&gt; [:require] do
+    testcases        = ENV['TESTCASES']
+    browsers_to_test = ENV['BROWSERS'] &amp;&amp; ENV['BROWSERS'].split(',')
+    tests_to_run     = ENV['TESTS'] &amp;&amp; ENV['TESTS'].split(',')
+    runner           = UnittestJS::WEBrickRunner::Runner.new(:test_dir =&gt; PROTOTYPE_TMP_DIR)
+
+    Dir[File.join(PROTOTYPE_TMP_DIR, '*_test.html')].each do |file|
+      file = File.basename(file)
+      test = file.sub('_test.html', '')
+      unless tests_to_run &amp;&amp; !tests_to_run.include?(test)
+        runner.add_test(file, testcases)
+      end
+    end
+    
+    UnittestJS::Browser::SUPPORTED.each do |browser|
+      unless browsers_to_test &amp;&amp; !browsers_to_test.include?(browser)
+        runner.add_browser(browser.to_sym)
+      end
+    end
+    
+    trap('INT') { runner.teardown; exit }
+    runner.run
+  end
   
-  Dir.mkdir(PROTOTYPE_TMP_DIR) unless File.exist?(PROTOTYPE_TMP_DIR)
+  task :build =&gt; [:clean, :dist] do
+    builder = UnittestJS::Builder::SuiteBuilder.new({
+      :input_dir  =&gt; PROTOTYPE_TEST_UNIT_DIR,
+      :assets_dir =&gt; PROTOTYPE_DIST_DIR
+    })
+    selected_tests = (ENV['TESTS'] || '').split(',')
+    builder.collect(*selected_tests)
+    builder.render
+  end
   
-  Dir[&quot;test/unit/tmp/*_test.html&quot;].each do |file|
-    test_name = File.basename(file).sub(&quot;_test.html&quot;, &quot;&quot;)
-    unless tests_to_run &amp;&amp; !tests_to_run.include?(test_name)
-      t.run(&quot;/#{file}&quot;, testcases)
-    end
+  task :clean =&gt; [:require] do
+    UnittestJS::Builder.empty_dir!(PROTOTYPE_TMP_DIR)
   end
   
-  %w( safari firefox ie konqueror opera chrome ).each do |browser|
-    t.browser(browser.to_sym) unless browsers_to_test &amp;&amp; !browsers_to_test.include?(browser)
+  task :require do
+    lib = 'vendor/unittest_js/lib/unittest_js'
+    unless File.exists?(lib)
+      puts &quot;\nYou'll need UnittestJS to run the tests. Just run:\n\n&quot;
+      puts &quot;  $ git submodule init&quot;
+      puts &quot;  $ git submodule update&quot;
+      puts &quot;\nand you should be all set.\n\n&quot;
+    end
+    require lib
   end
 end
 
-task :build_unit_tests do
-  Dir[File.join('test', 'unit', '*_test.js')].each do |file|
-    PageBuilder.new(file, 'prototype.erb').render
-  end
+task :test_units do
+  puts '&quot;rake test_units&quot; is deprecated. Please use &quot;rake test&quot; instead.'
 end
 
-task :clean_package_source do
-  rm_rf File.join(PROTOTYPE_PKG_DIR, &quot;prototype-#{PROTOTYPE_VERSION}&quot;)
+task :build_unit_tests do
+  puts '&quot;rake test_units&quot; is deprecated. Please use &quot;rake test:build&quot; instead.'
 end
 
-desc 'Generates an empty tmp directory for building tests.'
 task :clean_tmp do
-  puts 'Generating an empty tmp directory for building tests.'
-  FileUtils.rm_rf(PROTOTYPE_TMP_DIR) if File.exist?(PROTOTYPE_TMP_DIR)
-  Dir.mkdir(PROTOTYPE_TMP_DIR)
+  puts '&quot;rake clean_tmp&quot; is deprecated. Please use &quot;rake test:clean&quot; instead.'
 end</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -313,7 +313,7 @@ new Test.Unit.Runner({
 
     // with empty action attribute
     request = $(&quot;ffe&quot;).request({ method: 'post' });
-    this.assert(request.url.include(&quot;unit/tmp/form_test.html&quot;),
+    this.assert(request.url.include(&quot;/tmp/form_test.html&quot;),
       'wrong default action for form element with empty action attribute');
   },
   </diff>
      <filename>test/unit/form_test.js</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>test/lib/assets/test.css</filename>
    </removed>
    <removed>
      <filename>test/lib/assets/unittest.js</filename>
    </removed>
    <removed>
      <filename>test/lib/jstest.rb</filename>
    </removed>
    <removed>
      <filename>test/lib/templates/default.erb</filename>
    </removed>
    <removed>
      <filename>test/lib/templates/prototype.erb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>1d617df4df4b2ae8dff41038c59ee67928e0f3cd</id>
    </parent>
  </parents>
  <author>
    <name>Tobie Langel</name>
    <email>tobie.langel@gmail.com</email>
  </author>
  <url>http://github.com/sstephenson/prototype/commit/52a781ae2a9a078d38869e8a7f76d9561fb31d8a</url>
  <id>52a781ae2a9a078d38869e8a7f76d9561fb31d8a</id>
  <committed-date>2008-12-11T09:01:31-08:00</committed-date>
  <authored-date>2008-12-11T09:01:31-08:00</authored-date>
  <message>Switch to UnittestJS.</message>
  <tree>7bf95223cb4be824da96da93edca778322e0f1e9</tree>
  <committer>
    <name>Tobie Langel</name>
    <email>tobie.langel@gmail.com</email>
  </committer>
</commit>
