Skip to content

Commit

Permalink
Fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaspiller committed Jul 19, 2011
1 parent c3c5340 commit 8c7a628
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/stream_client_test.erl
Expand Up @@ -240,13 +240,14 @@ handle_connection_passes_data_to_callback_test() ->
stream_client:handle_connection(Callback, RequestId)
end),

Data = data1234,
Data = <<"{\"text\":\"data1234\"}">>,
DecodedData = [{<<"text">>, <<"data1234">>}],
Child ! {http, {RequestId, stream, Data}},

receive
{CallbackPid, callback, CallbackData} ->
?assertNot(Child =:= CallbackPid),
?assertEqual(Data, CallbackData)
?assertEqual(DecodedData, CallbackData)
after 100 ->
?assert(timeout)
end.
Expand All @@ -263,14 +264,15 @@ handle_connection_full_flow_test() ->
Parent ! {self(), response, Response}
end),

Data = data1234,
Data = <<"{\"text\":\"data1234\"}">>,
DecodedData = [{<<"text">>, <<"data1234">>}],
Child ! {http, {RequestId, stream_start, []}},
Child ! {http, {RequestId, stream, Data}},
Child ! {http, {RequestId, stream_end, []}},

receive
{_CallbackPid, callback, CallbackData} ->
?assertEqual(Data, CallbackData)
?assertEqual(DecodedData, CallbackData)
after 100 ->
?assert(timeout_callback)
end,
Expand Down

0 comments on commit 8c7a628

Please sign in to comment.