public
Description: Spam blocking plugin with support for Akismet and Defensio.
Homepage:
Clone URL: git://github.com/technoweenie/viking.git
viking / .autotest
100644 30 lines (23 sloc) 0.891 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|
  at.clear_mappings
  
  # Any change to spec_helper should result in all specs being run
  at.add_mapping %r%^spec/spec_helper\.rb$% do |_, m|
    at.files_matching %r%^spec/.*_spec\.rb$%
  end
  
  # Any change to an example should result in running itself
  at.add_mapping %r%^spec/(lib|core_ext)/.*_spec\.rb$% do |filename, _|
    filename
  end
  
  # Any core extension should result in all specs being run
  at.add_mapping %r%^lib/core_ext/.*\.rb$% do |_, m|
    at.files_matching %r%^spec/.*_spec\.rb$%
  end
  
  # Any change to viking.rb should run all specs
  at.add_mapping %r%^lib/viking.rb$% do |_, m|
    at.files_matching %r%^spec/.*_spec\.rb$%
  end
  
  # Any change to an engine should result in that spec being run
  at.add_mapping %r%^lib/viking/(.*)\.rb$% do |_, m|
    at.files_matching %r%^spec/lib/#{m[1]}_spec\.rb$%
  end
end