Simpler progressbar and handle --koan=<KOAN> better
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
defmodule DisplayTest do
|
||||
use ExUnit.Case
|
||||
|
||||
test "puts counter on the right until half the koans are complete" do
|
||||
bar = Display.progress_bar(%{total: 12, current: 3})
|
||||
assert bar == "|==========> (3/12) |"
|
||||
test "empty bar" do
|
||||
bar = Display.progress_bar(%{total: 12, current: 0})
|
||||
assert bar == "| | 0 of 12"
|
||||
end
|
||||
|
||||
test "puts the counter on the left after half the koans are complete" do
|
||||
bar = Display.progress_bar(%{total: 12, current: 10})
|
||||
assert bar == "|(10/12)========================> |"
|
||||
test "puts counter on the right until half the koans are complete" do
|
||||
bar = Display.progress_bar(%{total: 12, current: 3})
|
||||
assert bar == "|=======> | 3 of 12"
|
||||
end
|
||||
|
||||
|
||||
test "full bar" do
|
||||
bar = Display.progress_bar(%{total: 12, current: 12})
|
||||
assert bar == "|(12/12)===============================>|"
|
||||
assert bar == "|=============================>| 12 of 12"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user