module TestLauncher::CLI

Public Class Methods

launch(argv, env, shell: Shell::HistoryRunner.new(shell: Shell::Runner.new(log_path: '/tmp/test_launcher.log')), searcher: Search.searcher(shell)) { |command| ... } click to toggle source
# File lib/test_launcher/cli.rb, line 40
def self.launch(argv, env, shell: Shell::HistoryRunner.new(shell: Shell::Runner.new(log_path: '/tmp/test_launcher.log')), searcher: Search.searcher(shell))
  options = CLI::InputParser.new(
    argv,
    env
  ).parsed_options(shell: shell, searcher: searcher)

  # TODO: Well, this isn't pretty anymore...

  if options.rerun
    shell.reexec
  elsif command = MultiFrameworkQuery.new(options).command
    command = yield(command) if block_given?
    if command
      shell.exec(command)
    else
      command
    end
  else
    shell.warn "No tests found."
  end
rescue BaseError => e
  shell.warn(e)
end