Class: Autotest::Micronaut
- Inherits:
-
Autotest
- Object
- Autotest
- Autotest::Micronaut
- Defined in:
- lib/autotest/micronaut-rails.rb
Instance Method Summary collapse
- #consolidate_failures(failed) ⇒ Object
-
#initialize ⇒ Micronaut
constructor
A new instance of Micronaut.
- #make_test_cmd(files_to_test) ⇒ Object
Constructor Details
#initialize ⇒ Micronaut
Returns a new instance of Micronaut.
22 23 24 25 26 |
# File 'lib/autotest/micronaut-rails.rb', line 22 def initialize super self.failed_results_re = /^\d+\)\n(?:\e\[\d*m)?(?:.*?Error in )?'([^\n]*)'(?: FAILED)?(?:\e\[\d*m)?\n(.*?)\n\n/m self.completed_re = /\n(?:\e\[\d*m)?\d* examples?/m end |
Instance Method Details
#consolidate_failures(failed) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/autotest/micronaut-rails.rb', line 28 def consolidate_failures(failed) filters = new_hash_of_arrays failed.each do |spec, trace| if trace =~ /\n(\.\/)?(.*example\.rb):[\d]+:\Z?/ filters[$2] << spec end end return filters end |
#make_test_cmd(files_to_test) ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'lib/autotest/micronaut-rails.rb', line 38 def make_test_cmd(files_to_test) return '' if files_to_test.empty? examples = files_to_test.keys.flatten examples.map! {|f| %Q(require "#{f}")} return "#{ruby} -e '#{examples.join("; ")}'" end |