Module: TestLauncher::CLI

Defined in:
lib/test_launcher/cli.rb,
lib/test_launcher/cli/options.rb,
lib/test_launcher/cli/request.rb,
lib/test_launcher/cli/input_parser.rb

Defined Under Namespace

Classes: InputParser, MultiFrameworkQuery, Options, Request

Class Method Summary collapse

Class Method Details

.launch(argv, env, shell: Shell::HistoryRunner.new(shell: Shell::Runner.new(log_path: '/tmp/test_launcher.log')), searcher: Search.searcher(shell)) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/test_launcher/cli.rb', line 45

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