fix coffeescript compile error support
This commit is contained in:
parent
5f025c9b91
commit
46d1027982
@ -71,8 +71,16 @@ module Jasmine
|
|||||||
|
|
||||||
%{<script type="text/javascript">#{CoffeeScript.compile(data)}</script>}
|
%{<script type="text/javascript">#{CoffeeScript.compile(data)}</script>}
|
||||||
rescue CoffeeScript::CompilationError => e
|
rescue CoffeeScript::CompilationError => e
|
||||||
puts "[%s] %s: %s" % [ 'coffeescript'.color(:red), file.color(:yellow), e.message.to_s.color(:white) ]
|
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
|
exit 1
|
||||||
|
ensure
|
||||||
|
fh.close
|
||||||
|
end
|
||||||
|
end
|
||||||
ensure
|
ensure
|
||||||
files.clear
|
files.clear
|
||||||
end
|
end
|
||||||
|
@ -64,6 +64,15 @@ describe "jasmine-headless-webkit" do
|
|||||||
end
|
end
|
||||||
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
|
describe 'with filtered run' do
|
||||||
context "don't run a full run, just the filtered run" do
|
context "don't run a full run, just the filtered run" do
|
||||||
it "should succeed and run both" do
|
it "should succeed and run both" do
|
||||||
|
10
spec/jasmine/coffeescript_error/coffeescript_error.yml
Normal file
10
spec/jasmine/coffeescript_error/coffeescript_error.yml
Normal 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: .
|
||||||
|
|
2
spec/jasmine/coffeescript_error/spec.coffee
Normal file
2
spec/jasmine/coffeescript_error/spec.coffee
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
if
|
||||||
|
|
2
spec/jasmine/coffeescript_error/src.coffee
Normal file
2
spec/jasmine/coffeescript_error/src.coffee
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
a = "1"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user