dkubb / dm-core forked from datamapper/dm-core

DataMapper - Core

This URL has Read+Write access

dm-core / .autotest
100644 30 lines (23 sloc) 1.025 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Autotest.add_hook :initialize do |at|
  %w[ .git burn www log plugins script tasks bin CHANGELOG FAQ MIT-LICENSE PERFORMANCE QUICKLINKS README ].each do |exception|
    at.add_exception(exception)
  end
 
  at.clear_mappings
 
  spec_folders = /(?:semi)?public/
 
  # when a file is updated, make sure it's dependent public and semipublic specs pass
  at.add_mapping %r{\Alib/dm\-core/(.+)\.rb\z} do |_,match|
    at.files_matching %r{\Aspec/#{spec_folders}/#{match[1]}_spec\.rb\z}
  end
 
  # when the spec configuration changes make sure all specs pass
  at.add_mapping %r{\Aspec/spec_helper\.rb\z} do
    at.files_matching %r{\Aspec/.+_spec\.rb\z}
  end
 
  # when a spec is updated, make sure it passes
  at.add_mapping %r{\Aspec/#{spec_folders}/(.+)_spec\.rb\z} do |filename,_|
    filename
  end
 
  # when the collection shared spec is update, make sure all dependent specs pass
  at.add_mapping %r{\Aspec/lib/collection_shared_spec\.rb\z} do
    at.files_matching %r{\Aspec/#{spec_folders}/collection_spec\.rb\z}
  end
end