Skip to content

Commit

Permalink
Use maps for opts of the test module
Browse files Browse the repository at this point in the history
  • Loading branch information
chrzaszcz committed Apr 6, 2022
1 parent 582200e commit 28e306b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions big_tests/tests/dynamic_domains_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ init_per_group(with_mod_dynamic_domains_test, Config) ->
[ok = rpc(mim(), meck, new, [Module, [passthrough, no_link]])
|| Module <- MockedModules],
dynamic_modules:start(?HOST_TYPE, mod_dynamic_domains_test,
[{host1, subhost_pattern("subdomain1.@HOST@")},
{host2, subhost_pattern("subdomain2.@HOST@")},
{namespace, <<"dummy.namespace">>}]),
#{host1 => subhost_pattern("subdomain1.@HOST@"),
host2 => subhost_pattern("subdomain2.@HOST@"),
namespace => <<"dummy.namespace">>}),
[{reset_meck, MockedModules} | Config];
init_per_group(_, Config) ->
Config.
Expand Down
24 changes: 12 additions & 12 deletions src/mod_dynamic_domains_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@

-spec config_spec() -> mongoose_config_spec:config_section().
config_spec() ->
#section{items = #{
<<"host1">> =>
#option{type = string,
validate = subdomain_template,
process = fun mongoose_subdomain_utils:make_subdomain_pattern/1},
<<"host2">> =>
#option{type = string,
validate = subdomain_template,
process = fun mongoose_subdomain_utils:make_subdomain_pattern/1},
<<"namespace">> =>
#option{type = binary,
validate = non_empty}}}.
#section{items = #{<<"host1">> =>
#option{type = string,
validate = subdomain_template,
process = fun mongoose_subdomain_utils:make_subdomain_pattern/1},
<<"host2">> =>
#option{type = string,
validate = subdomain_template,
process = fun mongoose_subdomain_utils:make_subdomain_pattern/1},
<<"namespace">> =>
#option{type = binary,
validate = non_empty}},
format_items = map}.

supported_features() -> [dynamic_domains].

Expand Down

0 comments on commit 28e306b

Please sign in to comment.