From 1b4948f7efaac3b4e3477c0ff5151e001b9e01e8 Mon Sep 17 00:00:00 2001 From: Makis Otman Date: Sun, 6 Mar 2016 13:36:17 +0000 Subject: [PATCH] Clear screen on every run --- lib/display.ex | 8 ++++---- lib/runner.ex | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/display.ex b/lib/display.ex index 7b58519..6967c11 100644 --- a/lib/display.ex +++ b/lib/display.ex @@ -3,7 +3,7 @@ defmodule Display do @current_dir File.cwd! def show_failure(%{expr: expr}, module, name) do - IO.puts("") + clear_screen IO.puts("Now meditate upon #{display_module(module)}") IO.puts("---------------------------------------") IO.puts(format_cyan(display_failed_assertion(module, expr))) @@ -15,9 +15,9 @@ defmodule Display do IO.puts("Considering #{display_module(module)}...") end - def before_run do - IO.puts("") - IO.puts("") + def clear_screen do + IO.puts(ANSI.clear) + IO.puts(ANSI.home) end def display_failed_assertion(module, expr) do diff --git a/lib/runner.ex b/lib/runner.ex index 9a049b4..b25ae8b 100644 --- a/lib/runner.ex +++ b/lib/runner.ex @@ -13,8 +13,6 @@ defmodule Runner do end def run(start_module) do - Display.before_run - start_idx = Enum.find_index(@modules, &(&1 == start_module)) Enum.drop(@modules, start_idx) |> Enum.take_while(fn(mod) ->