-
Notifications
You must be signed in to change notification settings - Fork 2
/
autotest
40 lines (34 loc) · 950 Bytes
/
autotest
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
31
32
33
34
35
36
37
38
39
40
# ~.autotest
#require 'autotest_notification'
#SPEAKING = false
#DOOM_EDITION = false
#BUUF = false
#PENDING = false
#STICKY = false
#SUCCESS_SOUND = ''
#FAILURE_SOUND = ''
require 'autotest/fsevent'
require 'autotest/growl'
Autotest.add_hook :initialize do |autotest|
autotest.add_mapping(/^test.*\/.*_test\.rb$/) do |filename, _|
filename
end
end
# Avoid showing unable to map class to a file messages.
Autotest.class_eval do
def consolidate_failures(failed)
filters = new_hash_of_arrays
class_map = Hash[*self.find_order.grep(/^test/).map { |f| # TODO: ugly
[path_to_classname(f), f]
}.flatten]
class_map.merge!(self.extra_class_map)
failed.each do |method, klass|
if class_map.has_key? klass then
filters[class_map[klass]] << method
# else
# output.puts "Unable to map class #{klass} to a file"
end
end
return filters
end
end