Autotest.add_hook :initialize do |at| at.add_mapping(%r%^lib/.*\.rb$%, true) { |filename, _| at.files_matching %r%^spec/.*_spec.rb$% } end