fix coffeescript compile error support

This commit is contained in:
John Bintz 2011-06-10 17:14:50 -04:00
parent 5f025c9b91
commit 46d1027982
5 changed files with 33 additions and 2 deletions

View File

@ -71,8 +71,16 @@ module Jasmine
%{<script type="text/javascript">#{CoffeeScript.compile(data)}</script>}
rescue CoffeeScript::CompilationError => e
puts "[%s] %s: %s" % [ 'coffeescript'.color(:red), file.color(:yellow), e.message.to_s.color(:white) ]
exit 1
files.each do |file|
begin
CoffeeScript.compile(fh = File.open(file))
rescue CoffeeScript::CompilationError => ne
puts "[%s] %s: %s" % [ 'coffeescript'.color(:red), file.color(:yellow), ne.message.to_s.color(:white) ]
exit 1
ensure
fh.close
end
end
ensure
files.clear
end

View File

@ -64,6 +64,15 @@ describe "jasmine-headless-webkit" do
end
end
describe 'with coffeescript error' do
it "should fail" do
system %{bin/jasmine-headless-webkit -j spec/jasmine/coffeescript_error/coffeescript_error.yml --report #{report}}
$?.exitstatus.should == 1
File.exist?(report).should be_false
end
end
describe 'with filtered run' do
context "don't run a full run, just the filtered run" do
it "should succeed and run both" do

View File

@ -0,0 +1,10 @@
src_files:
- spec/jasmine/coffeescript_error/src.coffee
spec_files:
- spec/jasmine/coffeescript_error/spec.coffee
src_dir: .
spec_dir: .

View File

@ -0,0 +1,2 @@
if

View File

@ -0,0 +1,2 @@
a = "1"