class TestLauncher::Queries::SpecifiedNameQuery

Public Instance Methods

command() click to toggle source
# File lib/test_launcher/queries.rb, line 116
def command
  if test_cases.empty?
    shell.warn("Could not identify file: #{request.search_string}")
  elsif test_cases.size == 1
    shell.notify("Found 1 example in 1 file.")
    runner.single_example(test_cases.first)
  else
    shell.notify "Found #{pluralize(test_cases.size, "example")} in #{pluralize(file_count, "file")}."
    shell.notify "Running most recently edited. Run with '--all' to run all the tests."
    runner.single_example(most_recently_edited_test_case)
  end
end
potential_files() click to toggle source
# File lib/test_launcher/queries.rb, line 139
def potential_files
  @potential_files ||= searcher.test_files(request.search_string)
end
test_cases() click to toggle source
# File lib/test_launcher/queries.rb, line 129
def test_cases
  @test_cases ||= potential_files.map {|file|
    request.test_case(
      file: file,
      example: request.example_name,
      request: request,
    )
  }
end