require 'autotest' class AutotestAniki def self.play(type) `aplay -q #{resource(type.to_s + '.wav')}` end private def self.resource(file) File.expand_path(File.dirname(__FILE__) + '/../res/' + file) end end Autotest.add_hook :green do |at| AutotestAniki.play(:green) end Autotest.add_hook :red do |at| AutotestAniki.play(:red) end