Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (22 sloc) 0.624 kB
class Autotest
def path_to_classname(s)
sep = File::SEPARATOR
f = s.sub(/^test#{sep}/, '').sub(/\.rb$/, '').split(sep)
f = f.map { |path| path.split(/_|(\d+)/).map { |seg| seg.capitalize }.join }
f.join('::')
end
end
Autotest.add_hook :initialize do |autotest|
autotest.add_mapping(%r%^test/.*\.rb$%) do |filename, _|
filename
end
autotest.add_mapping(%r%^lib/(.*)\.rb$%) do |_, m|
["test/#{m[1]}_test.rb"]
end
autotest.add_mapping(%r%^test/test_helper.rb$%) do
files_matching %r%^test/.*_test\.rb$%
end
end
Autotest.add_discovery do
"testunit"
end
Jump to Line
Something went wrong with that request. Please try again.