relevance / streamlined

This URL has Read+Write access

streamlined / autotest / streamlined.rb
100644 22 lines (21 sloc) 0.533 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# TODO - autotest blows up right now, needs work
class Autotest::Streamlined < Autotest
  def initialize
    super
    @exceptions = /\/\./
    @test_mappings = {
/^lib\/(.*)\.rb$/ => proc { |filename, m|
        file = File.basename(filename).gsub("_", "_?").gsub(".rb", "")
        files = files_matching %r%^test/.*#{file}_test.rb$%
      },
/^test\/.*_test\.rb$/ => proc { |filename, _|
        filename
      }
    }
  end
  
  def files_matching regexp
    @files.keys.select { |k|
      k =~ regexp
    }
  end
end