Class: Guard::JRubyRSpec::Containment

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/jruby-rspec/containment.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Containment

Returns a new instance of Containment.



4
5
6
# File 'lib/guard/jruby-rspec/containment.rb', line 4

def initialize(options = {})
  @error_handler = options.fetch(:error_handler, method(:output_as_guard_error))
end

Instance Method Details

#protectObject



8
9
10
11
12
13
# File 'lib/guard/jruby-rspec/containment.rb', line 8

def protect
  yield
rescue Exception => e
  error_handler.call e
  throw :task_has_failed
end