Class: Guard::RSpec::Inspectors::KeepingInspector

Inherits:
BaseInspector
  • Object
show all
Defined in:
lib/guard/rspec/inspectors/keeping_inspector.rb

Overview

Inspector that remembers all failed paths and returns that paths in future calls to #paths method along with any new paths passed as parameter to #paths

Instance Attribute Summary collapse

Attributes inherited from BaseInspector

#options, #spec_paths

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ KeepingInspector

Returns a new instance of KeepingInspector.



12
13
14
15
# File 'lib/guard/rspec/inspectors/keeping_inspector.rb', line 12

def initialize(options = {})
  super
  @failed_locations = []
end

Instance Attribute Details

#failed_locationsObject

Returns the value of attribute failed_locations.



10
11
12
# File 'lib/guard/rspec/inspectors/keeping_inspector.rb', line 10

def failed_locations
  @failed_locations
end

Instance Method Details

#failed(locations) ⇒ Object



21
22
23
# File 'lib/guard/rspec/inspectors/keeping_inspector.rb', line 21

def failed(locations)
  @failed_locations = locations
end

#paths(paths) ⇒ Object



17
18
19
# File 'lib/guard/rspec/inspectors/keeping_inspector.rb', line 17

def paths(paths)
  _with_failed_locations(_clean(paths))
end

#reloadObject



25
26
27
# File 'lib/guard/rspec/inspectors/keeping_inspector.rb', line 25

def reload
  @failed_locations = []
end