diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-11-19 23:43:50 +0000 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-11-19 23:50:14 +0000 |
commit | bf347caa55588b1f38cfaed267111d4c0163d522 (patch) | |
tree | 0f496cfdcc8e591cba6281a74362ce2c714eb62a /test | |
parent | 73c3c5552ae50e9cebd3873f8baaf8812f9a9dbf (diff) |
Handle force flags in leading position
The checking of flags and the parsing of arguments is separated up.
Diffstat (limited to 'test')
-rw-r--r-- | test/rebar_new_SUITE.erl | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/test/rebar_new_SUITE.erl b/test/rebar_new_SUITE.erl index 3cee6f2..b514a2b 100644 --- a/test/rebar_new_SUITE.erl +++ b/test/rebar_new_SUITE.erl @@ -6,7 +6,8 @@ -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). -all() -> [app_git_user, app_hg_user, app_with_fallbacks]. +all() -> [app_git_user, app_hg_user, app_with_fallbacks, + app_with_flags1, app_with_flags2]. init_per_testcase(Case, Config0) -> @@ -95,6 +96,42 @@ app_hg_user(Config) -> {filename:join(["src", Name++"_app.erl"]), [Name]} ]). +app_with_flags1(Config) -> + Name = ?config(name, Config), + rebar_test_utils:run_and_check( + Config, [], + ["new", "test_app", "-f", Name], + {ok, []} + ), + validate_files( + Config, Name, + [{"LICENSE", []}, + {"README.md", []}, + {".gitignore", []}, + {"rebar.config", []}, + {filename:join(["src", Name++".app.src"]), [Name]}, + {filename:join(["src", Name++"_sup.erl"]), [Name]}, + {filename:join(["src", Name++"_app.erl"]), [Name]} + ]). + +app_with_flags2(Config) -> + Name = ?config(name, Config), + rebar_test_utils:run_and_check( + Config, [], + ["new", "-f", "test_app", Name], + {ok, []} + ), + validate_files( + Config, Name, + [{"LICENSE", []}, + {"README.md", []}, + {".gitignore", []}, + {"rebar.config", []}, + {filename:join(["src", Name++".app.src"]), [Name]}, + {filename:join(["src", Name++"_sup.erl"]), [Name]}, + {filename:join(["src", Name++"_app.erl"]), [Name]} + ]). + validate_files(_Config, Name, Checks) -> [begin Path = filename:join([Name, File]), |