Class Autotest::Rspec

  1. lib/autotest/rspec.rb
Parent: Autotest

Methods

public class

  1. new

public instance

  1. consolidate_failures
  2. make_test_cmd

Public class methods

new ()
[show source]
# File lib/autotest/rspec.rb, line 22
  def initialize
    super
    self.failed_results_re = /^\d+\)\n(?:\e\[\d*m)?(?:.*?in )?'([^\n]*)'(?: FAILED)?(?:\e\[\d*m)?\n(.*?)\n\n/m
    self.completed_re = /\n(?:\e\[\d*m)?\d* examples?/m
  end

Public instance methods

consolidate_failures (failed)
[show source]
# File lib/autotest/rspec.rb, line 28
  def consolidate_failures(failed)
    filters = new_hash_of_arrays
    failed.each do |spec, trace|
      if trace =~ /\n(\.\/)?(.*spec\.rb):[\d]+:/
        filters[$2] << spec
      end
    end
    return filters
  end
make_test_cmd (files_to_test)
[show source]
# File lib/autotest/rspec.rb, line 38
  def make_test_cmd(files_to_test)
    return '' if files_to_test.empty?
    spec_program = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'spec'))
    return "#{ruby} #{spec_program} --autospec #{files_to_test.keys.flatten.join(' ')} #{add_options_if_present}"
  end