Add a progress bar that also displays the number of koans.

This commit is contained in:
Felipe Sere
2016-04-24 19:37:13 +01:00
parent 1625ef7d99
commit 2b2240340e
2 changed files with 64 additions and 1 deletions

18
test/display_test.exs Normal file
View File

@@ -0,0 +1,18 @@
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) |"
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)========================> |"
end
test "full bar" do
bar = Display.progress_bar(%{total: 12, current: 12})
assert bar == "|(12/12)===============================>|"
end
end