Merge pull request #118 from elixirkoans/clear-by-default
Make clearing the screen the default
This commit is contained in:
@@ -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.
|
and fill in the blanks to make the koans pass one by one.
|
||||||
The autorunner will give you feedback each time you save.
|
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
|
```sh
|
||||||
$ mix meditate --clear-screen
|
$ mix meditate --no-clear-screen
|
||||||
```
|
```
|
||||||
|
|
||||||
### Contributing
|
### Contributing
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
defmodule Options do
|
defmodule Options do
|
||||||
@defaults %{
|
@defaults %{
|
||||||
clear_screen: false,
|
clear_screen: true,
|
||||||
initial_koan: Equalities,
|
initial_koan: Equalities,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,6 +27,6 @@ defmodule Options do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def parse_argument("--koan="<>module), do: %{ initial_koan: String.to_atom("Elixir."<> module)}
|
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: %{}
|
def parse_argument(_), do: %{}
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ defmodule OptionTest do
|
|||||||
|
|
||||||
test "has default options" do
|
test "has default options" do
|
||||||
Options.start([])
|
Options.start([])
|
||||||
refute Options.clear_screen?
|
assert Options.clear_screen?
|
||||||
end
|
end
|
||||||
|
|
||||||
test "override clearing of screen" do
|
test "override clearing of screen" do
|
||||||
Options.start(["--clear-screen"])
|
Options.start(["--no-clear-screen"])
|
||||||
assert Options.clear_screen?
|
refute Options.clear_screen?
|
||||||
end
|
end
|
||||||
|
|
||||||
test "can target specifc koans" do
|
test "can target specifc koans" do
|
||||||
@@ -18,6 +18,6 @@ defmodule OptionTest do
|
|||||||
|
|
||||||
test "ignores unknown options" do
|
test "ignores unknown options" do
|
||||||
Options.start(["--foo"])
|
Options.start(["--foo"])
|
||||||
refute Options.clear_screen?
|
assert Options.clear_screen?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user