Module: RSpecWatcher
- Defined in:
- lib/rspec-watcher.rb,
lib/rspec_watcher/railtie.rb,
lib/rspec_watcher/version.rb
Defined Under Namespace
Classes: Railtie
Constant Summary collapse
- SPEC_INFERRER =
->(_modified, _added, _removed) { [] }
- PATH_INFERRER =
->(path) { Rails.root.join(path) }
- RELOADER =
-> { Rails.application.reloader.reload! }
- VERSION =
'0.3.2'
Class Attribute Summary collapse
-
.path_inferrer ⇒ Object
Returns the value of attribute path_inferrer.
-
.reloader ⇒ Object
Returns the value of attribute reloader.
-
.rules ⇒ Object
readonly
Returns the value of attribute rules.
Class Method Summary collapse
Class Attribute Details
.path_inferrer ⇒ Object
Returns the value of attribute path_inferrer.
19 20 21 |
# File 'lib/rspec-watcher.rb', line 19 def path_inferrer @path_inferrer end |
.reloader ⇒ Object
Returns the value of attribute reloader.
19 20 21 |
# File 'lib/rspec-watcher.rb', line 19 def reloader @reloader end |
.rules ⇒ Object (readonly)
Returns the value of attribute rules.
20 21 22 |
# File 'lib/rspec-watcher.rb', line 20 def rules @rules end |
Class Method Details
.configure(&block) ⇒ Object
22 23 24 25 26 |
# File 'lib/rspec-watcher.rb', line 22 def configure(&block) @rules = [] @failed_specs = [] instance_exec(&block) end |
.start ⇒ Object
33 34 35 |
# File 'lib/rspec-watcher.rb', line 33 def start listeners.each(&:start) end |
.watch(path, **options, &inferrer) ⇒ Object
28 29 30 31 |
# File 'lib/rspec-watcher.rb', line 28 def watch(path, **, &inferrer) inferrer ||= SPEC_INFERRER rules << [path, , inferrer] end |