# File lib/autotest/rspec2.rb, line 10 def initialize super() clear_mappings setup_rspec_project_mappings # Example for Ruby 1.8: http://rubular.com/r/AOXNVDrZpx # Example for Ruby 1.9: http://rubular.com/r/85ag5AZ2jP self.failed_results_re = /^\s*\d+\).*\n\s+(?:\e\[\d*m)?Failure.*(\n(?:\e\[\d*m)?\s+#\s(.*)?:\d+(?::.*)?(?:\e\[\d*m)?)+$/ self.completed_re = /\n(?:\e\[\d*m)?\d* examples?/ end
# File lib/autotest/rspec2.rb, line 33 def consolidate_failures(failed) filters = new_hash_of_arrays failed.each do |spec, trace| if trace =~ /(.*spec\.rb)/ filters[$1] << spec end end return filters end
# File lib/autotest/rspec2.rb, line 63 def gemfile? File.exist?('./Gemfile') end
# File lib/autotest/rspec2.rb, line 43 def make_test_cmd(files_to_test) files_to_test.empty? ? '' : "#{prefix}#{ruby}#{suffix} -S #{SPEC_PROGRAM} --tty #{normalize(files_to_test).keys.flatten.map { |f| "'#{f}'"}.join(' ')}" end
# File lib/autotest/rspec2.rb, line 48 def normalize(files_to_test) files_to_test.keys.inject({}) do |result, filename| result[File.expand_path(filename)] = [] result end end
# File lib/autotest/rspec2.rb, line 21 def setup_rspec_project_mappings add_mapping(%^spec/.*_spec\.rb$%) { |filename, _| filename } add_mapping(%^lib/(.*)\.rb$%) { |_, m| ["spec/#{m[1]}_spec.rb"] } add_mapping(%^spec/(spec_helper|shared/.*)\.rb$%) { files_matching %^spec/.*_spec\.rb$% } end
Generated with the Darkfish Rdoc Generator 2.