Extracts modules for different sections of the UI

This commit is contained in:
Felipe Sere
2016-05-13 11:03:53 +01:00
parent 8a8a0be771
commit af543d1b62
8 changed files with 141 additions and 4 deletions

View File

@@ -0,0 +1,21 @@
defmodule ProgressBarTest do
use ExUnit.Case
alias Display.ProgressBar
test "empty bar" do
bar = ProgressBar.progress_bar(%{total: 12, current: 0})
assert bar == "| | 0 of 12"
end
test "puts counter on the right until half the koans are complete" do
bar = ProgressBar.progress_bar(%{total: 12, current: 3})
assert bar == "|=======> | 3 of 12"
end
test "full bar" do
bar = ProgressBar.progress_bar(%{total: 12, current: 12})
assert bar == "|=============================>| 12 of 12"
end
end