Class: Nicetest::TestFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/nicetest/test_finder.rb

Defined Under Namespace

Classes: RangeFinder

Instance Method Summary collapse

Constructor Details

#initializeTestFinder

Returns a new instance of TestFinder.



8
9
10
# File 'lib/nicetest/test_finder.rb', line 8

def initialize
  @parse_cache = {}
end

Instance Method Details

#filter_for(target) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/nicetest/test_finder.rb', line 12

def filter_for(target)
  filename, lineno = target.split(":", 2)
  filepath = File.expand_path(filename)
  lineno = lineno&.to_i

  return [filepath, nil] unless lineno

  [filepath, find_test(filepath, lineno)]
end