elixir-book/issues/test/cli_test.exs

20 lines
566 B
Elixir

defmodule CliTest do
use ExUnit.Case
doctest Issues
import Issues.CLI, only: [parse_args: 1]
test ":help returned by option parsing the -h and --help options" do
assert parse_args(["-h", "anything"]) == :help
assert parse_args(["--help", "anything"]) == :help
end
test "three values returned if three given" do
assert parse_args(["user", "project", "99"]) == {"user", "project", 99}
end
test "two values and default count returned if two values given" do
assert parse_args(["user", "project"]) == {"user", "project", 4}
end
end