Object
# File lib/guard/rspec/runner.rb, line 12 def initialize(options = {}) @options = { :bundler => true, :binstubs => false, :rvm => nil, :cli => nil, :env => nil, :notification => true, :spring => false, :turnip => false, :zeus => false }.merge(options) unless ENV['SPEC_OPTS'].nil? UI.warning "The SPEC_OPTS environment variable is present. This can conflict with guard-rspec, particularly notifications." end if @options[:bundler] && @options[:zeus] && !@options[:binstubs] UI.warning "Running Zeus within bundler is waste of time. It is recommended to set bundler option to false, when using zeus." end deprecations_warnings end
# File lib/guard/rspec/runner.rb, line 56 def failure_exit_code_supported? @failure_exit_code_supported ||= begin cmd_parts = [] cmd_parts << "bundle exec" if bundle_exec? cmd_parts << rspec_executable cmd_parts << "--help" `#{cmd_parts.join(' ')}`.include? "--failure-exit-code" end end
# File lib/guard/rspec/runner.rb, line 66 def parsed_or_default_formatter @parsed_or_default_formatter ||= begin # Use RSpec's parser to parse formatters formatters = ::RSpec::Core::ConfigurationOptions.new([]).parse_options()[:formatters] # Use a default formatter if none exists. # RSpec's parser returns an array in the format [[formatter, output], ...], so match their format formatters = [['progress']] if formatters.nil? || formatters.empty? # Construct a matching command line option, including output target formatters.map { |formatter| "-f #{formatter.join ' -o '}" }.join ' ' end end
# File lib/guard/rspec/runner.rb, line 51 def rspec_executable command = parallel? ? 'parallel_rspec' : 'rspec' @rspec_executable ||= (binstubs? && !executable_prefix?) ? "#{binstubs}/#{command}" : command end
# File lib/guard/rspec/runner.rb, line 36 def run(paths, options = {}) return false if paths.empty? message = options[:message] || "Running: #{paths.join(' ')}" UI.info(message, :reset => true) options = @options.merge(options) if drb_used? run_via_drb(paths, options) else run_via_shell(paths, options) end end
Generated with the Darkfish Rdoc Generator 2.