public
Description: Prototype JavaScript framework
Homepage: http://prototypejs.org/
Clone URL: git://github.com/sstephenson/prototype.git
Search Repo:
Make Rake auto-generate test/unit/temp directory if it is missing.
tobie (author)
Wed Apr 23 03:05:30 -0700 2008
commit  5202fc39915d042e7d76f41798c720109a264abe
tree    8f788bf99a4de12748833339907903b18507bf6e
parent  aaff1f57f588c4231e05942e304e212093ee61ac
...
54
55
56
 
57
58
59
60
 
 
61
62
63
64
65
66
 
67
68
69
...
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
 
69
70
71
72
0
@@ -54,16 +54,19 @@
0
   testcases = ENV['TESTCASES']
0
   tests_to_run = ENV['TESTS'] && ENV['TESTS'].split(',')
0
   browsers_to_test = ENV['BROWSERS'] && ENV['BROWSERS'].split(',')
0
+ tmp_dir = "test/unit/tmp"
0
   
0
   t.mount("/dist")
0
   t.mount("/test")
0
   
0
+ Dir.mkdir(tmp_dir) unless File.exist?(tmp_dir)
0
+
0
   Dir["test/unit/*_test.js"].each do |file|
0
     TestBuilder.new(file).render
0
     test_file = File.basename(file, ".js")
0
     test_name = test_file.sub("_test", "")
0
     unless tests_to_run && !tests_to_run.include?(test_name)
0
- t.run("/test/unit/tmp/#{test_file}.html", testcases)
0
+ t.run("/#{tmp_dir}/#{test_file}.html", testcases)
0
     end
0
   end
0
   
...
429
430
431
432
433
434
 
 
 
 
435
436
437
...
465
466
467
468
 
469
470
...
429
430
431
 
 
 
432
433
434
435
436
437
438
...
466
467
468
 
469
470
471
0
@@ -429,9 +429,10 @@
0
 end
0
 
0
 class TestBuilder
0
- UNITTEST_DIR = File.expand_path('test')
0
- TEMPLATE = File.join(UNITTEST_DIR, 'lib', 'template.erb')
0
- FIXTURES_DIR = File.join(UNITTEST_DIR, 'unit', 'fixtures')
0
+ UNITTEST_DIR = File.expand_path('test')
0
+ FIXTURES_DIR = File.join(UNITTEST_DIR, 'unit', 'fixtures')
0
+ TMP_DIR = File.join(UNITTEST_DIR, 'unit', 'tmp')
0
+ TEMPLATE = File.join(UNITTEST_DIR, 'lib', 'template.erb')
0
   
0
   def initialize(filename, template = TEMPLATE)
0
     @filename = filename
0
@@ -465,7 +466,7 @@
0
   
0
   def destination
0
     filename = File.basename(@filename, ".js")
0
- File.join(UNITTEST_DIR, 'unit', 'tmp', "#{filename}.html")
0
+ File.join(TMP_DIR, "#{filename}.html")
0
   end
0
 end

Comments

    No one has commented yet.