From 0b508d490d6dad4b1243319465559a0fd0a59240 Mon Sep 17 00:00:00 2001 From: Felipe Sere Date: Sun, 15 May 2016 18:33:59 +0200 Subject: [PATCH] Make clearing the screen the default --- README.md | 4 ++-- lib/options.ex | 4 ++-- test/options_test.exs | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c398775..e9207f9 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,10 @@ You should see the first failure. Open the corresponding file in your favourite and fill in the blanks to make the koans pass one by one. The autorunner will give you feedback each time you save. -To make the autorunner less noisy, you can start the koans with +If you want the autorunner to show you your previous results, run it with `--no-clear-screen` ```sh -$ mix meditate --clear-screen +$ mix meditate --no-clear-screen ``` ### Contributing diff --git a/lib/options.ex b/lib/options.ex index ba86d65..46069f0 100644 --- a/lib/options.ex +++ b/lib/options.ex @@ -1,6 +1,6 @@ defmodule Options do @defaults %{ - clear_screen: false, + clear_screen: true, initial_koan: Equalities, } @@ -27,6 +27,6 @@ defmodule Options do end def parse_argument("--koan="<>module), do: %{ initial_koan: String.to_atom("Elixir."<> module)} - def parse_argument("--clear-screen"), do: %{ clear_screen: true} + def parse_argument("--no-clear-screen"), do: %{ clear_screen: false} def parse_argument(_), do: %{} end diff --git a/test/options_test.exs b/test/options_test.exs index 8d9a04a..00985b4 100644 --- a/test/options_test.exs +++ b/test/options_test.exs @@ -3,12 +3,12 @@ defmodule OptionTest do test "has default options" do Options.start([]) - refute Options.clear_screen? + assert Options.clear_screen? end test "override clearing of screen" do - Options.start(["--clear-screen"]) - assert Options.clear_screen? + Options.start(["--no-clear-screen"]) + refute Options.clear_screen? end test "can target specifc koans" do @@ -18,6 +18,6 @@ defmodule OptionTest do test "ignores unknown options" do Options.start(["--foo"]) - refute Options.clear_screen? + assert Options.clear_screen? end end