Class: TestLauncher::Frameworks::Base::Searcher

Inherits:
Struct
  • Object
show all
Defined in:
lib/test_launcher/frameworks/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#raw_searcherObject

Returns the value of attribute raw_searcher

Returns:

  • (Object)

    the current value of raw_searcher



6
7
8
# File 'lib/test_launcher/frameworks/base.rb', line 6

def raw_searcher
  @raw_searcher
end

Instance Method Details

#by_line(file_pattern, line_number) ⇒ Object

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/test_launcher/frameworks/base.rb', line 21

def (file_pattern, line_number)
  raise NotImplementedError
end

#examples(query) ⇒ Object



13
14
15
# File 'lib/test_launcher/frameworks/base.rb', line 13

def examples(query)
  grep(example_name_regex(query))
end

#grep(regex) ⇒ Object



17
18
19
# File 'lib/test_launcher/frameworks/base.rb', line 17

def grep(regex)
  raw_searcher.grep(regex, file_pattern: file_name_pattern)
end

#test_files(query) ⇒ Object



7
8
9
10
11
# File 'lib/test_launcher/frameworks/base.rb', line 7

def test_files(query)
  raw_searcher
    .find_files(query)
    .select {|f| f.match(file_name_regex)}
end