Added error on console log config

This commit is contained in:
Harry Lascelles 2012-07-28 12:46:22 +01:00
parent 8ace079731
commit fb7d864cd0

View File

@ -3,11 +3,12 @@ module Jasmine
class Task class Task
include Rake::DSL if defined?(Rake::DSL) include Rake::DSL if defined?(Rake::DSL)
attr_accessor :colors, :keep_on_error, :jasmine_config attr_accessor :colors, :keep_on_error, :jasmine_config, :error_on_console_log
def initialize(name = 'jasmine:headless') def initialize(name = 'jasmine:headless')
@colors = false @colors = false
@keep_on_error = false @keep_on_error = false
@error_on_console_log = true
@jasmine_config = nil @jasmine_config = nil
yield self if block_given? yield self if block_given?
@ -27,9 +28,9 @@ module Jasmine
when 1 when 1
raise Jasmine::Headless::TestFailure raise Jasmine::Headless::TestFailure
when 2 when 2
raise Jasmine::Headless::ConsoleLogUsage raise Jasmine::Headless::ConsoleLogUsage if @error_on_console_log
else else
p "Unexpected Jasmine::Headless error code #{result}" p "Unexpected Jasmine::Headless error code #{result}. If 127, check native extensions have been compiled."
raise Jasmine::Headless::TestFailure raise Jasmine::Headless::TestFailure
end end
end end