class Guard::JRubyRSpec::Containment

Attributes

error_handler[R]

Public Class Methods

new(options = {}) click to toggle source
# File lib/guard/jruby-rspec/containment.rb, line 4
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-rspec/containment.rb, line 8
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-rspec/containment.rb, line 19
def output_as_guard_error(exception)
  UI.error $!.message
  UI.error $!.backtrace.join "\n"
end