Rearrange format_error/2 arguments to match existing conventions

This commit is contained in:
Juan Jose Comellas
2013-07-19 02:00:36 -03:00
parent 2f0a25a13e
commit 078d003a93
2 changed files with 17 additions and 11 deletions
+6 -3
View File
@@ -292,10 +292,13 @@ check_test_() ->
{ok, {Opts, _}} = parse(OptSpecList, ""),
[
{"Check required options",
?_assertEqual({error, {missing_required_option, arg}}, check(Opts, OptSpecList))},
?_assertEqual({error, {missing_required_option, arg}}, check(OptSpecList, Opts))},
{"Parse arguments and check required options",
?_assertEqual({error, {missing_required_option, arg}}, parse_and_check(OptSpecList, ""))},
{"Format error test",
{"Format error test 1",
?_assertEqual("missing required option: -a (arg)",
format_error({missing_required_option, arg}, OptSpecList))}
format_error(OptSpecList, {error, {missing_required_option, arg}}))},
{"Format error test 2",
?_assertEqual("missing required option: -a (arg)",
format_error(OptSpecList, {missing_required_option, arg}))}
].