Skip to content
This repository has been archived by the owner on May 5, 2019. It is now read-only.

Commit

Permalink
two consecutive writes produces one message
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Good committed Apr 9, 2012
1 parent 012117f commit 1d5fe79
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/smtp-client-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ vows.describe('smtp client').addBatch({
},
},

'given two messages with pipelining and shared writeHead': {
'given a single message in two parts': {
topic: function () {
var mock = new mocksmtp.MockSmtpServer(
['EHLO test\r\n', 'MAIL FROM:<sender>\r\nRCPT TO:<rcpt>\r\nDATA\r\n', 'message contents\r\n.\r\nMAIL FROM:<sender>\r\nRCPT TO:<rcpt>\r\nDATA\r\n', 'message contents 2\r\n.\r\nQUIT\r\n'],
['220 Welcome\r\n', '250-Hello\r\n250 PIPELINING\r\n', '250 Ok\r\n250 Ok\r\n354 Go ahead\r\n', '250 Accepted\r\n250 Ok\r\n250 Ok\r\n354 Go ahead\r\n', '250 Accepted\r\n221 Goodbye\r\n']
['EHLO test\r\n', 'MAIL FROM:<sender>\r\nRCPT TO:<rcpt>\r\nDATA\r\n', 'line one\r\nline two\r\n.\r\nQUIT\r\n'],
['220 Welcome\r\n', '250-Hello\r\n250 PIPELINING\r\n', '250 Ok\r\n250 Ok\r\n354 Go ahead\r\n', '250 Accepted\r\n221 Goodbye\r\n']
);
var self = this, i = 0;
var req = smtp.request({stream: mock, ehlo: 'test'}, function (reply, command) {
Expand All @@ -153,8 +153,8 @@ vows.describe('smtp client').addBatch({
});
mock.start();
req.writeHead("sender", ["rcpt"]);
req.write("message contents");
req.end("message contents 2");
req.write("line one\r\n");
req.end("line two");
},

'sends a message response': function (i) {
Expand Down

0 comments on commit 1d5fe79

Please sign in to comment.