Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds spec test suite and compile script.
- Loading branch information
1 parent
51d7b38
commit a28719a
Showing
8 changed files
with
3,065 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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!' |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.