Class: Guard::RSpec

Inherits:
Plugin
  • Object
show all
Defined in:
lib/guard/rspec.rb,
lib/guard/rspec/dsl.rb,
lib/guard/rspec/runner.rb,
lib/guard/rspec/command.rb,
lib/guard/rspec/options.rb,
lib/guard/rspec/notifier.rb,
lib/guard/rspec/deprecator.rb,
lib/guard/rspec/inspectors/factory.rb,
lib/guard/rspec/inspectors/base_inspector.rb,
lib/guard/rspec/inspectors/simple_inspector.rb,
lib/guard/rspec/inspectors/focused_inspector.rb,
lib/guard/rspec/inspectors/keeping_inspector.rb

Defined Under Namespace

Modules: Inspectors, Options Classes: Command, Deprecator, Dsl, Notifier, Runner

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ RSpec



20
21
22
23
24
25
# File 'lib/guard/rspec.rb', line 20

def initialize(options = {})
  super
  @options = Options.with_defaults(options)
  Deprecator.warns_about_deprecated_options(@options)
  @runner = Runner.new(@options)
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options



18
19
20
# File 'lib/guard/rspec.rb', line 18

def options
  @options
end

#runnerObject

Returns the value of attribute runner



18
19
20
# File 'lib/guard/rspec.rb', line 18

def runner
  @runner
end

Instance Method Details

#reloadObject



36
37
38
# File 'lib/guard/rspec.rb', line 36

def reload
  runner.reload
end

#run_allObject



32
33
34
# File 'lib/guard/rspec.rb', line 32

def run_all
  _throw_if_failed { runner.run_all }
end

#run_on_modifications(paths) ⇒ Object



40
41
42
43
# File 'lib/guard/rspec.rb', line 40

def run_on_modifications(paths)
  return false if paths.empty?
  _throw_if_failed { runner.run(paths) }
end

#startObject



27
28
29
30
# File 'lib/guard/rspec.rb', line 27

def start
  Guard::Compat::UI.info "Guard::RSpec is running"
  run_all if options[:all_on_start]
end