diff options
Diffstat (limited to 'test/autobahn_SUITE.erl')
-rw-r--r-- | test/autobahn_SUITE.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/autobahn_SUITE.erl b/test/autobahn_SUITE.erl index 9ae9d7a..61cf631 100644 --- a/test/autobahn_SUITE.erl +++ b/test/autobahn_SUITE.erl @@ -64,7 +64,7 @@ end_per_suite(_Config) -> init_per_group(autobahn, Config) -> Port = 33080, cowboy:start_http(autobahn, 100, [{port, Port}], [ - {dispatch, init_dispatch()} + {env, [{dispatch, init_dispatch()}]} ]), [{port, Port}|Config]. @@ -75,8 +75,8 @@ end_per_group(Listener, _Config) -> %% Dispatch configuration. init_dispatch() -> - [{[<<"localhost">>], [ - {[<<"echo">>], websocket_echo_handler, []}]}]. + cowboy_router:compile([{"localhost", [ + {"/echo", websocket_echo_handler, []}]}]). %% autobahn cases @@ -92,7 +92,7 @@ run_tests(Config) -> _ -> ok end, {ok, IndexHTML} = file:read_file(IndexFile), - case binary:match(IndexHTML, <<"Fail">>) of - {_, _} -> erlang:error(failed); - nomatch -> ok + case length(binary:matches(IndexHTML, <<"case_failed">>)) > 2 of + true -> erlang:error(failed); + false -> ok end. |