File: .autotest

package info (click to toggle)
ruby-growl 4.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 224 kB
  • sloc: ruby: 1,807; makefile: 4
file content (16 lines) | stat: -rw-r--r-- 480 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'autotest/restart'

Autotest.add_hook :initialize do |at|
  at.add_exception '.git'
  at.testlib = 'minitest/autorun'
  at.unit_diff = 'cat'

  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('Gntp', 'GNTP').gsub('Udp', 'UDP')
  end
end