mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-19 03:44:23 -05:00
added comprehensive linting to the test suit
This commit is contained in:
@@ -2,6 +2,8 @@ require 'test_helper'
|
|||||||
|
|
||||||
class ExecutionTest < Test::Unit::TestCase
|
class ExecutionTest < Test::Unit::TestCase
|
||||||
|
|
||||||
|
NO_WARNINGS = /\A(0 error\(s\), 0 warning\(s\)\n)+\Z/
|
||||||
|
|
||||||
def test_execution_of_coffeescript
|
def test_execution_of_coffeescript
|
||||||
`bin/coffee-script test/fixtures/execution/*.cs`
|
`bin/coffee-script test/fixtures/execution/*.cs`
|
||||||
sources = Dir['test/fixtures/execution/*.js'].map {|f| File.expand_path(f) }
|
sources = Dir['test/fixtures/execution/*.js'].map {|f| File.expand_path(f) }
|
||||||
@@ -15,4 +17,14 @@ class ExecutionTest < Test::Unit::TestCase
|
|||||||
Dir.chdir(starting_place)
|
Dir.chdir(starting_place)
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user