Autotest.add_hook :initialize do |at|
  at.clear_mappings

  at.add_mapping(%r{^spec/.+_spec\.rb$}) do |filename,_|
    filename
  end

  at.add_mapping(%r{^lib/patron/(.+)\.rb$}) do |_,match|
    [ "spec/#{match[1]}_spec.rb" ]
  end

  at.add_mapping(%r{^spec/spec_helper\.rb$}) do
    at.files_matching(%r{^spec/.+_spec\.rb$})
  end
end
