diff options
author | Loïc Hoguin <[email protected]> | 2018-11-19 09:05:34 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-11-19 09:05:34 +0100 |
commit | bed328b6c9ce41782c340a89554599a838574d82 (patch) | |
tree | 065bd9faad0b6abe234302b599624fe6981fad5d /test/misc_SUITE.erl | |
parent | 6cc3b0ccca6c06592c2a1881cae39945de805747 (diff) | |
download | cowboy-bed328b6c9ce41782c340a89554599a838574d82.tar.gz cowboy-bed328b6c9ce41782c340a89554599a838574d82.tar.bz2 cowboy-bed328b6c9ce41782c340a89554599a838574d82.zip |
Use ?FUNCTION_NAME instead of ct_helper:name()
Cowboy is 19+ so it's OK to use it.
Diffstat (limited to 'test/misc_SUITE.erl')
-rw-r--r-- | test/misc_SUITE.erl | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/misc_SUITE.erl b/test/misc_SUITE.erl index 6f44774..4ad2325 100644 --- a/test/misc_SUITE.erl +++ b/test/misc_SUITE.erl @@ -18,7 +18,6 @@ -import(ct_helper, [config/2]). -import(ct_helper, [doc/1]). --import(ct_helper, [name/0]). -import(cowboy_test, [gun_open/1]). all() -> @@ -80,13 +79,13 @@ router_invalid_path(Config) -> set_env(Config0) -> doc("Live replace a middleware environment value."), - Config = cowboy_test:init_http(name(), #{ + Config = cowboy_test:init_http(?FUNCTION_NAME, #{ env => #{dispatch => []} }, Config0), ConnPid1 = gun_open(Config), Ref1 = gun:get(ConnPid1, "/"), {response, _, 400, _} = gun:await(ConnPid1, Ref1), - cowboy:set_env(name(), dispatch, init_dispatch(Config)), + cowboy:set_env(?FUNCTION_NAME, dispatch, init_dispatch(Config)), %% Only new connections get the updated environment. ConnPid2 = gun_open(Config), Ref2 = gun:get(ConnPid2, "/"), @@ -95,11 +94,11 @@ set_env(Config0) -> set_env_missing(Config0) -> doc("Live replace a middleware environment value when env was not provided."), - Config = cowboy_test:init_http(name(), #{}, Config0), + Config = cowboy_test:init_http(?FUNCTION_NAME, #{}, Config0), ConnPid1 = gun_open(Config), Ref1 = gun:get(ConnPid1, "/"), {response, _, 500, _} = gun:await(ConnPid1, Ref1), - cowboy:set_env(name(), dispatch, []), + cowboy:set_env(?FUNCTION_NAME, dispatch, []), %% Only new connections get the updated environment. ConnPid2 = gun_open(Config), Ref2 = gun:get(ConnPid2, "/"), |