class Guard::JRubyMinitest::Containment
Attributes
error_handler[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/guard/jruby-minitest/containment.rb, line 5 def initialize(options = {}) @error_handler = options.fetch(:error_handler, method(:output_as_guard_error)) end
Public Instance Methods
protect() { || ... }
click to toggle source
# File lib/guard/jruby-minitest/containment.rb, line 9 def protect yield rescue Exception => e error_handler.call e throw :task_has_failed end
Private Instance Methods
output_as_guard_error(exception)
click to toggle source
# File lib/guard/jruby-minitest/containment.rb, line 20 def output_as_guard_error(exception) UI.error $!.message UI.error $!.backtrace.join "\n" end