From 4505d4f1ed6a7ba0d390f262bdeee9c35bc5d7a4 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 10 Sep 2012 08:23:12 -0500 Subject: add config validation support to the system --- test/rclt_command_SUITE.erl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/rclt_command_SUITE.erl b/test/rclt_command_SUITE.erl index 5967cc5..5adf54a 100644 --- a/test/rclt_command_SUITE.erl +++ b/test/rclt_command_SUITE.erl @@ -26,7 +26,8 @@ normal_passing_case/1, lib_fail_case/1, output_fail_case/1, - spec_parse_fail_case/1]). + spec_parse_fail_case/1, + config_fail_case/1]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). @@ -41,7 +42,7 @@ end_per_suite(_Config) -> ok. all() -> - [normal_passing_case, lib_fail_case, output_fail_case]. + [normal_passing_case, lib_fail_case, output_fail_case, config_fail_case]. normal_passing_case(Config) -> DataDir = proplists:get_value(data_dir, Config), @@ -98,3 +99,9 @@ spec_parse_fail_case(_Config) -> CmdLine = ["-g", Spec], ?assertMatch({error, {failed_to_parse, _Spec}}, rcl_cmd_args:args2state(getopt:parse(relcool:opt_spec_list(), CmdLine))). + +config_fail_case(_Config) -> + ConfigFile = "does-not-exist", + CmdLine = [ConfigFile], + ?assertMatch({error, {invalid_config_file, ConfigFile}}, + rcl_cmd_args:args2state(getopt:parse(relcool:opt_spec_list(), CmdLine))). -- cgit v1.2.3