Skip to content

Commit

Permalink
Fix matching clause
Browse files Browse the repository at this point in the history
  • Loading branch information
msoedov committed May 17, 2017
1 parent 0b5001b commit 4fd87c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/firex.ex
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ defmodule Firex do
{_, plain, []} when is_list(plain) ->
[name|fn_args] = plain
invoke(__MODULE__, name |> String.to_atom, fn_args, state)
{_, [_], _} ->
{_, _, _} ->
state
end
end
Expand Down
4 changes: 4 additions & 0 deletions test/firex_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ defmodule FirexTest do
assert Firex.Simple.main(["should_takes_bool", "-f", "1"])
end

test "it should grasefully handle extra arguments" do
assert Firex.Simple.main(["should_takes_bool", "-f", "1", "2"])
end

test "it should convert int arg" do
assert Firex.Simple.main(["should_takes_int", "-n", "1"])
refute Firex.Simple.main(["should_takes_int", "-n", "1n"])
Expand Down

0 comments on commit 4fd87c4

Please sign in to comment.