Class: Autotest::Rspec
- Defined in:
- lib/vendor/plugins/rspec/lib/autotest/rspec.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#add_options_if_present ⇒ Object
:nodoc:.
- #consolidate_failures(failed) ⇒ Object
-
#initialize ⇒ Rspec
constructor
A new instance of Rspec.
- #make_test_cmd(files_to_test) ⇒ Object
Constructor Details
#initialize ⇒ Rspec
Returns a new instance of Rspec.
22 23 24 25 26 |
# File 'lib/vendor/plugins/rspec/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\n\(.*?)?)\n\n/m self.completed_re = /\n(?:\e\[\d*m)?\d* examples?/m end |
Instance Method Details
#add_options_if_present ⇒ Object
:nodoc:
44 45 46 |
# File 'lib/vendor/plugins/rspec/lib/autotest/rspec.rb', line 44 def # :nodoc: File.exist?("spec/spec.opts") ? "-O spec/spec.opts " : "" end |
#consolidate_failures(failed) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/vendor/plugins/rspec/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) ⇒ Object
38 39 40 41 42 |
# File 'lib/vendor/plugins/rspec/lib/autotest/rspec.rb', line 38 def make_test_cmd(files_to_test) return '' if files_to_test.empty? spec_program = File.(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'spec')) return "#{ruby} #{spec_program} --autospec #{files_to_test.keys.flatten.join(' ')} #{}" end |