Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 88b4eaad81
Fetching contributors…

Cannot retrieve contributors at this time

48 lines (37 sloc) 1.339 kB
require 'autotest'
Autotest.add_hook :initialize do |at|
at.clear_mappings
at.failed_results_re = /^\d+\)\n(?:\e\[\d*m)?(?:.*?Error in )?'([^\n]*)'(?: FAILED)?(?:\e\[\d*m)?\n(.*?)\n\n/m
at.completed_re = /\n(?:\e\[\d*m)?\d* examples?/m
# watch out: Ruby bug (1.8.6):
# %r(/) != /\//
at.add_mapping(%r%^examples/.*_example.rb$%) { |filename, _|
filename
}
at.add_mapping(%r%^lib/(.*)\.rb$%) { |filename, m|
["examples/lib/#{m[1]}_example.rb"]
}
at.add_mapping(%r%^examples/(example_helper|shared/.*)\.rb$%) {
at.files_matching %r%^examples/.*_example\.rb$%
}
end
class MicronautCommandError < StandardError; end
class Autotest::MicronautRails < Autotest
remove_method :consolidate_failures if instance_methods(false).include?("consolidate_failures")
remove_method :make_test_cmd if instance_methods(false).include?("make_test_cmd")
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
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
end
Jump to Line
Something went wrong with that request. Please try again.