class Shindo::Tests

def prompt(description, &block)

def prompt(description, &block)
  return if Thread.main[:exit] || Thread.current[:reload]
  Formatador.display("Action? [c,q,r,?]? ")
  choice = STDIN.gets.strip
  continue = false
  Formatador.display_line
  Formatador.indent do
    case choice
    when 'c', 'continue'
      continue = true
    when 'q', 'quit', 'exit'
      Formatador.display_line("Exiting...")
      Thread.main[:exit] = true
    when 'r', 'reload'
      Formatador.display_line("Reloading...")
      Thread.current[:reload] = true
    when '?', 'help'
      Formatador.display_lines([
        'c - ignore this error and continue',
        'q - quit Shindo',
        'r - reload and run the tests again',
        '? - display help'
      ])
    else
      Formatador.display_line("[red]#{choice} is not a valid choice, please try again.[/]")
    end
    Formatador.display_line
  end
  unless continue || Thread.main[:exit]
    Formatador.display_line("[red]- #{description}[/]")
    prompt(description, &block)
  end
end