# HG changeset patch # User Maxim Dounin # Date 1231786429 -10800 # Node ID 11e33ba0656a9ccd0c70957f4db440f04144fcb1 # Parent bc3351f157ef3578379055339471b1231f2a3dae Tests: check for 235 code on successful smtp auth. For now, convert only check for auth login with username test since it's already marked as TODO. diff --git a/lib/Test/Nginx/SMTP.pm b/lib/Test/Nginx/SMTP.pm --- a/lib/Test/Nginx/SMTP.pm +++ b/lib/Test/Nginx/SMTP.pm @@ -67,6 +67,11 @@ sub ok { Test::More->builder->like($self->read(), qr/^2\d\d /, @_); } +sub authok { + my $self = shift; + Test::More->builder->like($self->read(), qr/^235 /, @_); +} + ############################################################################### sub smtp_test_daemon { diff --git a/smtp.t b/smtp.t --- a/smtp.t +++ b/smtp.t @@ -141,7 +141,7 @@ local $TODO = 'not supported yet'; $s->send('AUTH LOGIN ' . encode_base64('test@example.com', '')); $s->check(qr/^334 UGFzc3dvcmQ6/, 'auth login with username password challenge'); $s->send(encode_base64('secret', '')); -$s->ok('auth login with username'); +$s->authok('auth login with username'); }