Skip to content

Commit

Permalink
Convert project to rebar - this was somewhat disruptive
Browse files Browse the repository at this point in the history
  • Loading branch information
Vagabond committed Oct 6, 2010
1 parent 3db8067 commit e50fc4b
Show file tree
Hide file tree
Showing 15 changed files with 430 additions and 742 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ coverage/*
.DS_Store
build
*.xcodeproj
.eunit/
287 changes: 0 additions & 287 deletions Rakefile

This file was deleted.

Binary file modified rebar
Binary file not shown.
3 changes: 2 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% -*- mode: erlang; -*-

{erl_opts, [fail_on_warning, debug_info]}.
{erl_first_files, ["src/gen_smtp_server_session.erl"]}.
{cover_enabled, true}.
{cover_print_enabled, true}.
File renamed without changes.
19 changes: 9 additions & 10 deletions src/gen_smtp_client.erl
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ session_start_test_() ->
{"simple session initiation",
fun() ->
Options = [{relay, "localhost"}, {port, 9876}, {hostname, "testing"}],
{ok, Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, _Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, X} = socket:accept(ListenSock, 1000),
socket:send(X, "220 Some banner\r\n"),
?assertMatch({ok, "EHLO testing\r\n"}, socket:recv(X, 0, 1000)),
Expand All @@ -487,7 +487,7 @@ session_start_test_() ->
{"retry on crashed EHLO twice if requested",
fun() ->
Options = [{relay, "localhost"}, {port, 9876}, {hostname, "testing"}, {retries, 2}],
{ok, Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, _Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, X} = socket:accept(ListenSock, 1000),
socket:send(X, "220 Some banner\r\n"),
?assertMatch({ok, "EHLO testing\r\n"}, socket:recv(X, 0, 1000)),
Expand Down Expand Up @@ -543,7 +543,7 @@ session_start_test_() ->
{"retry on 421 greeting",
fun() ->
Options = [{relay, "localhost"}, {port, 9876}, {hostname, "testing"}],
{ok, Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, _Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, X} = socket:accept(ListenSock, 1000),
socket:send(X, "421 can't you see I'm busy?\r\n"),
?assertMatch({ok, "QUIT\r\n"}, socket:recv(X, 0, 1000)),
Expand Down Expand Up @@ -581,7 +581,7 @@ session_start_test_() ->
{"a valid complete transaction without TLS advertised should succeed",
fun() ->
Options = [{relay, "localhost"}, {port, 9876}, {hostname, "testing"}],
{ok, Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, _Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, X} = socket:accept(ListenSock, 1000),
socket:send(X, "220 Some banner\r\n"),
?assertMatch({ok, "EHLO testing\r\n"}, socket:recv(X, 0, 1000)),
Expand All @@ -604,7 +604,7 @@ session_start_test_() ->
{"a valid complete transaction with TLS advertised should succeed",
fun() ->
Options = [{relay, "localhost"}, {port, 9876}, {hostname, "testing"}],
{ok, Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, _Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, X} = socket:accept(ListenSock, 1000),
socket:send(X, "220 Some banner\r\n"),
?assertMatch({ok, "EHLO testing\r\n"}, socket:recv(X, 0, 1000)),
Expand All @@ -614,8 +614,7 @@ session_start_test_() ->
application:start(public_key),
application:start(ssl),
socket:send(X, "220 ok\r\n"),
{ok, Y} = socket:to_ssl_server(X, [], 5000),
?debugFmt("got ssl socket~n", []),
{ok, Y} = socket:to_ssl_server(X, [{certfile, "../testdata/server.crt"}, {keyfile, "../testdata/server.key"}], 5000),
?assertMatch({ok, "EHLO testing\r\n"}, socket:recv(Y, 0, 1000)),
socket:send(Y, "250-hostname\r\n250 STARTTLS\r\n"),
?assertMatch({ok, "MAIL FROM: <test@foo.com>\r\n"}, socket:recv(Y, 0, 1000)),
Expand All @@ -636,7 +635,7 @@ session_start_test_() ->
{"AUTH PLAIN should work",
fun() ->
Options = [{relay, "localhost"}, {port, 9876}, {hostname, "testing"}, {username, "user"}, {password, "pass"}],
{ok, Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, _Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, X} = socket:accept(ListenSock, 1000),
socket:send(X, "220 Some banner\r\n"),
?assertMatch({ok, "EHLO testing\r\n"}, socket:recv(X, 0, 1000)),
Expand All @@ -654,7 +653,7 @@ session_start_test_() ->
{"AUTH LOGIN should work",
fun() ->
Options = [{relay, "localhost"}, {port, 9876}, {hostname, "testing"}, {username, "user"}, {password, "pass"}],
{ok, Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, _Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, X} = socket:accept(ListenSock, 1000),
socket:send(X, "220 Some banner\r\n"),
?assertMatch({ok, "EHLO testing\r\n"}, socket:recv(X, 0, 1000)),
Expand All @@ -676,7 +675,7 @@ session_start_test_() ->
{"AUTH CRAM-MD5 should work",
fun() ->
Options = [{relay, "localhost"}, {port, 9876}, {hostname, "testing"}, {username, "user"}, {password, "pass"}],
{ok, Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, _Pid} = send({"test@foo.com", ["foo@bar.com"], "hello world"}, Options),
{ok, X} = socket:accept(ListenSock, 1000),
socket:send(X, "220 Some banner\r\n"),
?assertMatch({ok, "EHLO testing\r\n"}, socket:recv(X, 0, 1000)),
Expand Down
Loading

0 comments on commit e50fc4b

Please sign in to comment.