Skip to content

Commit

Permalink
Merge fb583cc into 2077c53
Browse files Browse the repository at this point in the history
  • Loading branch information
fogfish committed May 15, 2019
2 parents 2077c53 + fb583cc commit 9a426f8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/m_http.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
datum,
hackney
]},
{mod, {m_http_app, []}},
{env, []}
]
}.
2 changes: 1 addition & 1 deletion src/m_http.erl
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ request() ->
lens:get(l_req_url(), State),
lens:get(l_req_headers(), State),
lens:get(l_req_payload(), State),
SOpts
[{pool, m_http_pool} | SOpts]
)
of
{ok, Code, Head, Stream} ->
Expand Down
16 changes: 16 additions & 0 deletions src/m_http_app.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-module(m_http_app).
-behaviour(application).

-export([start/2, stop/1]).

%%
%%
start(_Type, _Args) ->
ok = hackney_pool:start_pool(m_http_pool, []),
{ok, self()}.

%%
%%
stop(_State) ->
hackney_pool:stop_pool(m_http_pool),
ok.
10 changes: 9 additions & 1 deletion test/m_http_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
-compile({parse_transform, category}).
-compile({parse_transform, generic}).

-export([all/0]).
-export([all/0, init_per_suite/1, end_per_suite/1]).
-compile(export_all).

%%
Expand All @@ -33,6 +33,14 @@ all() ->
NAry =:= 1
].

%%
init_per_suite(Config) ->
{ok, _} = application:ensure_all_started(m_http),
Config.

end_per_suite(_) ->
application:stop(m_http).

%%
http_pass_method(_) ->
m_http_mock:init(200, [], []),
Expand Down

0 comments on commit 9a426f8

Please sign in to comment.