Make clearing the screen the default

This commit is contained in:
Felipe Sere
2016-05-15 18:33:59 +02:00
parent cee05dbfd6
commit 0b508d490d
3 changed files with 8 additions and 8 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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