Skip to content

Commit

Permalink
Wrap test/index.js to 80 characters
Browse files Browse the repository at this point in the history
Closes #5
  • Loading branch information
kenany committed Jul 21, 2014
1 parent b9dee6d commit 93412c1
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ test('gets abstract on given topic', function(t) {
var client = irc(stream);
client.use(nwitchAbstract());

var testCommand = ':[email protected] PRIVMSG #nwitch :' +
'!abstract numerology\r\n';

var n = 0;
stream.on('data', function(chunk) {
switch (n++) {
case 0:
t.equal(chunk, ':[email protected] PRIVMSG #nwitch :!abstract numerology\r\n');
t.equal(chunk, testCommand);
break;
case 1:
t.equal(chunk, 'PRIVMSG #nwitch :KenanY: Numerology is any belief in ' +
Expand All @@ -34,12 +37,13 @@ test('gets abstract on given topic', function(t) {
'by modern scientists.\r\n');
break;
case 2:
t.equal(chunk, 'PRIVMSG #nwitch :KenanY: https://en.wikipedia.org/wiki/Numerology\r\n');
t.equal(chunk, 'PRIVMSG #nwitch :KenanY: ' +
'https://en.wikipedia.org/wiki/Numerology\r\n');
break;
}
});

stream.write(':[email protected] PRIVMSG #nwitch :!abstract numerology\r\n');
stream.write(testCommand);
});

test('gets abstract on related topic', function(t) {
Expand All @@ -48,22 +52,26 @@ test('gets abstract on related topic', function(t) {
var client = irc(stream);
client.use(nwitchAbstract());

var testCommand = ':[email protected] PRIVMSG #nwitch :' +
'!abstract astronomy\r\n';

var n = 0;
stream.on('data', function(chunk) {
switch (n++) {
case 0:
t.equal(chunk, ':[email protected] PRIVMSG #nwitch :!abstract astronomy\r\n');
t.equal(chunk, testCommand);
break;
case 1:
t.equal(chunk, 'PRIVMSG #nwitch :KenanY: Astronomy A natural science that ' +
'is the study of celestial objects, the physics, ' +
t.equal(chunk, 'PRIVMSG #nwitch :KenanY: Astronomy A natural science ' +
'that is the study of celestial objects, the physics, ' +
'chemistry, and...\r\n');
break;
case 2:
t.equal(chunk, 'PRIVMSG #nwitch :KenanY: https://duckduckgo.com/Astronomy\r\n');
t.equal(chunk, 'PRIVMSG #nwitch :KenanY: ' +
'https://duckduckgo.com/Astronomy\r\n');
break;
}
});

stream.write(':[email protected] PRIVMSG #nwitch :!abstract astronomy\r\n');
stream.write(testCommand);
});

0 comments on commit 93412c1

Please sign in to comment.