-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #5
- Loading branch information
Showing
1 changed file
with
16 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 ' + | ||
|
@@ -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) { | ||
|
@@ -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); | ||
}); |