Ruby Autotest with add_mapping
问题 I am trying to add a hook in Autotest to trigger tests when javascript files are changed. Below the is the .autotest file I am using. The syntax seems to be correct, but nothing is happening when a javascript file is updated. The first hook works fine, the second does not. Autotest.add_hook :initialize do |at| at.add_mapping(%r%^spec/(selenium)/.*rb$%) { |filename, _| filename } at.add_mapping(%r%^public/(javascripts)/.*js$%) do |f, _| at.files_matching %r%^spec/(selenium)/.*rb$% end end 回答1: