mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
30 lines
863 B
Ruby
30 lines
863 B
Ruby
require 'test_helper'
|
|
|
|
class ExecutionTest < Test::Unit::TestCase
|
|
|
|
NO_WARNINGS = /\A(0 error\(s\), 0 warning\(s\)\n)+\Z/
|
|
|
|
def test_execution_of_coffeescript
|
|
`bin/coffee-script test/fixtures/execution/*.cs`
|
|
sources = Dir['test/fixtures/execution/*.js'].map {|f| File.expand_path(f) }
|
|
starting_place = File.expand_path(Dir.pwd)
|
|
Dir.chdir('/Users/jashkenas/Desktop/Beauty/Code/v8')
|
|
sources.each do |source|
|
|
# puts `./shell #{source}`
|
|
assert `./shell #{source}`.chomp.to_sym == :true
|
|
end
|
|
ensure
|
|
Dir.chdir(starting_place)
|
|
end
|
|
|
|
def test_lintless_coffeescript
|
|
lint_results = `bin/coffee-script -l test/fixtures/execution/*.cs`
|
|
assert lint_results.match(NO_WARNINGS)
|
|
end
|
|
|
|
def test_lintless_examples
|
|
lint_results = `bin/coffee-script -l examples/*.cs`
|
|
assert lint_results.match(NO_WARNINGS)
|
|
end
|
|
|
|
end
|