diff --git a/lib/jasmine/files_list.rb b/lib/jasmine/files_list.rb index f0cb693..d75c52f 100644 --- a/lib/jasmine/files_list.rb +++ b/lib/jasmine/files_list.rb @@ -71,8 +71,16 @@ module Jasmine %{} 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 diff --git a/spec/bin/jasmine-headless-webkit_spec.rb b/spec/bin/jasmine-headless-webkit_spec.rb index c1a10fc..b2ff9a5 100644 --- a/spec/bin/jasmine-headless-webkit_spec.rb +++ b/spec/bin/jasmine-headless-webkit_spec.rb @@ -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 diff --git a/spec/jasmine/coffeescript_error/coffeescript_error.yml b/spec/jasmine/coffeescript_error/coffeescript_error.yml new file mode 100644 index 0000000..07551a8 --- /dev/null +++ b/spec/jasmine/coffeescript_error/coffeescript_error.yml @@ -0,0 +1,10 @@ + +src_files: + - spec/jasmine/coffeescript_error/src.coffee + +spec_files: + - spec/jasmine/coffeescript_error/spec.coffee + +src_dir: . +spec_dir: . + diff --git a/spec/jasmine/coffeescript_error/spec.coffee b/spec/jasmine/coffeescript_error/spec.coffee new file mode 100644 index 0000000..c431477 --- /dev/null +++ b/spec/jasmine/coffeescript_error/spec.coffee @@ -0,0 +1,2 @@ +if + diff --git a/spec/jasmine/coffeescript_error/src.coffee b/spec/jasmine/coffeescript_error/src.coffee new file mode 100644 index 0000000..38214ba --- /dev/null +++ b/spec/jasmine/coffeescript_error/src.coffee @@ -0,0 +1,2 @@ +a = "1" +