Simpler progressbar and handle --koan=<KOAN> better

This commit is contained in:
Felipe Sere
2016-04-25 09:32:34 +01:00
parent 2b2240340e
commit ab72b0e908
5 changed files with 48 additions and 57 deletions

View File

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