This worked for me on ZenTest 3.5.1. Hope it helps.
# in .autotest
# You need to change the test_mappings accessor to look for the
different file name
Autotest.add_hook :initialize do |at|
at.test_mappings = {
/^lib\/.*\.rb$/ => proc { |filename, _|
at.files_matching %r%^test/#{File.basename(filename).gsub '_',
'_?'}.*$%
},
/^test\/.*_test\.rb$/ => proc { |filename, _|
filename
}
}
end
# Then you need to modify the path_to_classname method, otherwise it
will look for TestClassTest instead of TestClass
Autotest.send
![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
define_method,
![Stick Out Tongue :p :p](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
ath_to_classname) do |s|
sep = File::SEPARATOR
f = s.sub(/^test#{sep}/, '').sub(/\.rb$/, '').split(sep)
f = f.map { |path| path.split(/_/).map { |seg|
seg.capitalize }.join }
f = f.map { |path| path =~ /^Test/ ? path :
"Test#{path.gsub('Test','')}" }
f.join('::')
end