Skip to content

Commit

Permalink
Adds spec test suite and compile script.
Browse files Browse the repository at this point in the history
  • Loading branch information
DrkCloudStrife committed Jan 15, 2013
1 parent 51d7b38 commit a28719a
Show file tree
Hide file tree
Showing 8 changed files with 3,065 additions and 0 deletions.
43 changes: 43 additions & 0 deletions bin/compile-test-suite
@@ -0,0 +1,43 @@
#! /usr/bin/env ruby
@script_name = File.basename($0)
@version = '0.0.2'
@author = 'Eduardo Garibay'

def help
puts %"
Author: #{@author}
Version: #{@version}
Descriprion: Compiles all the different tests into a master test_suite.js file
Run this file from root
Example:
$ ./bin/#{@script_name}
"
exit(0)
end
help if ARGV[0] == 'help'

source = './spec/test_suite'
destination = './spec/test_suite.js'
prefix = %"// Generated on: #{Time.now}
// Compiler: #{@script_name} - v#{@version}
pavlov.specify(\"Fields.js Test Suite\", function(){
"
suffix = "\n});"

puts 'Gathering tests...'
files = Dir.glob("#{source}/*.js")

puts 'Compiling...'
File.open(destination, 'w') do |file|
file.write(prefix)
files.each do |src|
test = File.open(src)
file.write("\n//#{src}\n")
file.write(test.read)
end
file.write(suffix)
end

puts 'All set!'
2 changes: 2 additions & 0 deletions spec/lib/jquery-1.8.3.min.js

Large diffs are not rendered by default.

0 comments on commit a28719a

Please sign in to comment.