2009-12-24 00:12:07 -08:00
|
|
|
require 'test_helper'
|
|
|
|
|
|
|
|
class ExecutionTest < Test::Unit::TestCase
|
|
|
|
|
2009-12-24 00:49:11 -08:00
|
|
|
NO_WARNINGS = /\A(0 error\(s\), 0 warning\(s\)\n)+\Z/
|
2009-12-24 22:29:30 -08:00
|
|
|
ALLS_WELL = /\A\n?(true\n)+\Z/
|
2009-12-24 00:49:11 -08:00
|
|
|
|
2009-12-24 00:12:07 -08:00
|
|
|
def test_execution_of_coffeescript
|
2009-12-24 22:29:30 -08:00
|
|
|
sources = ['test/fixtures/execution/*.cs'].join(' ')
|
2009-12-24 23:57:27 -08:00
|
|
|
assert `bin/coffee-script -r #{sources}`.match(ALLS_WELL)
|
2009-12-24 00:12:07 -08:00
|
|
|
end
|
|
|
|
|
2009-12-24 00:49:11 -08:00
|
|
|
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
|
|
|
|
|
2009-12-24 00:12:07 -08:00
|
|
|
end
|