Class: Guard::RSpec::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/rspec/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#rspec_versionObject (readonly)

Returns the value of attribute rspec_version.



4
5
6
# File 'lib/guard/rspec/runner.rb', line 4

def rspec_version
  @rspec_version
end

Instance Method Details

#run(paths, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/guard/rspec/runner.rb', line 6

def run(paths, options={})
  return false if paths.empty?
  message = options[:message] || "Running: #{paths.join(' ')}"
  UI.info(message, :reset => true)
  system(rspec_command(paths, options))

  if options[:notification] != false && !drb?(options) && failure_exit_code_supported?(options) && $? && !$?.success? && $?.exitstatus != failure_exit_code
    Notifier.notify("Failed", :title => "RSpec results", :image => :failed, :priority => 2)
  end

  $?.success?
end

#set_rspec_version(options = {}) ⇒ Object



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

def set_rspec_version(options={})
  @rspec_version = options[:version] || determine_rspec_version
end