Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 18 lines (13 sloc) 0.504 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# vim: filetype=ruby

require 'autotest/restart'
require 'autotest/isolate'

Autotest.add_hook :initialize do |at|
  at.testlib = 'minitest/unit' if at.respond_to? :testlib=

  def at.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 = f.map { |path| path =~ /^Test/ ? path : "Test#{path}" }
    f.join('::').gsub('Rdoc', 'RDoc').gsub('Ri', 'RI')
  end
end

Something went wrong with that request. Please try again.