Autotest.add_hook :initialize do |at| at.add_mapping(/ext\/.*\/(.*)\.[ch]/) do |_, m| ["test/test_#{m[1]}_extn.rb"] end end Autotest.add_hook :run_command do |at| system "rake compile" end