-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Factor out test data into a fixtures file.
This makes it easier to add more tests, keeps the test files themselves code-only, and makes ponies happy.
- Loading branch information
Chris Nehren
committed
Jan 13, 2015
1 parent
6c7e55c
commit 13b7b33
Showing
5 changed files
with
133 additions
and
121 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 |
---|---|---|
@@ -0,0 +1,118 @@ | ||
{ | ||
"basic": { | ||
"sent": [ | ||
["NICK testbot", "Client sent NICK message"], | ||
["USER nodebot 8 * :nodeJS IRC client", "Client sent USER message"], | ||
["QUIT :node-irc says goodbye", "Client sent QUIT message"] | ||
], | ||
|
||
"received": [ | ||
[":localhost 001 testbot :Welcome to the Internet Relay Chat Network testbot\r\n", "Received welcome message"] | ||
] | ||
}, | ||
"parse-line": { | ||
":irc.dollyfish.net.nz 372 nodebot :The message of the day was last changed: 2012-6-16 23:57": { | ||
"prefix": "irc.dollyfish.net.nz", | ||
"server": "irc.dollyfish.net.nz", | ||
"command": "rpl_motd", | ||
"rawCommand": "372", | ||
"commandType": "reply", | ||
"args": ["nodebot", "The message of the day was last changed: 2012-6-16 23:57"] | ||
}, | ||
":Ned!~martyn@irc.dollyfish.net.nz PRIVMSG #test :Hello nodebot!": { | ||
"prefix": "Ned!~martyn@irc.dollyfish.net.nz", | ||
"nick": "Ned", | ||
"user": "~martyn", | ||
"host": "irc.dollyfish.net.nz", | ||
"command": "PRIVMSG", | ||
"rawCommand": "PRIVMSG", | ||
"commandType": "normal", | ||
"args": ["#test", "Hello nodebot!"] | ||
}, | ||
":Ned!~martyn@irc.dollyfish.net.nz PRIVMSG #test ::-)": { | ||
"prefix": "Ned!~martyn@irc.dollyfish.net.nz", | ||
"nick": "Ned", | ||
"user": "~martyn", | ||
"host": "irc.dollyfish.net.nz", | ||
"command": "PRIVMSG", | ||
"rawCommand": "PRIVMSG", | ||
"commandType": "normal", | ||
"args": ["#test", ":-)"] | ||
}, | ||
":Ned!~martyn@irc.dollyfish.net.nz PRIVMSG #test ::": { | ||
"prefix": "Ned!~martyn@irc.dollyfish.net.nz", | ||
"nick": "Ned", | ||
"user": "~martyn", | ||
"host": "irc.dollyfish.net.nz", | ||
"command": "PRIVMSG", | ||
"rawCommand": "PRIVMSG", | ||
"commandType": "normal", | ||
"args": ["#test", ":"] | ||
}, | ||
":Ned!~martyn@irc.dollyfish.net.nz PRIVMSG #test ::^:^:": { | ||
"prefix": "Ned!~martyn@irc.dollyfish.net.nz", | ||
"nick": "Ned", | ||
"user": "~martyn", | ||
"host": "irc.dollyfish.net.nz", | ||
"command": "PRIVMSG", | ||
"rawCommand": "PRIVMSG", | ||
"commandType": "normal", | ||
"args": ["#test", ":^:^:"] | ||
}, | ||
":some.irc.net 324 webuser #channel +Cnj 5:10": { | ||
"prefix": "some.irc.net", | ||
"server": "some.irc.net", | ||
"command": "rpl_channelmodeis", | ||
"rawCommand": "324", | ||
"commandType": "reply", | ||
"args": ["webuser", "#channel", "+Cnj", "5:10"] | ||
}, | ||
":nick!user@host QUIT :Ping timeout: 252 seconds": { | ||
"prefix": "nick!user@host", | ||
"nick": "nick", | ||
"user": "user", | ||
"host": "host", | ||
"command": "QUIT", | ||
"rawCommand": "QUIT", | ||
"commandType": "normal", | ||
"args": ["Ping timeout: 252 seconds"] | ||
}, | ||
":nick!user@host PRIVMSG #channel :so : colons: :are :: not a problem ::::": { | ||
"prefix": "nick!user@host", | ||
"nick": "nick", | ||
"user": "user", | ||
"host": "host", | ||
"command": "PRIVMSG", | ||
"rawCommand": "PRIVMSG", | ||
"commandType": "normal", | ||
"args": ["#channel", "so : colons: :are :: not a problem ::::"] | ||
}, | ||
":pratchett.freenode.net 324 nodebot #ubuntu +CLcntjf 5:10 #ubuntu-unregged": { | ||
"prefix": "pratchett.freenode.net", | ||
"server": "pratchett.freenode.net", | ||
"command": "rpl_channelmodeis", | ||
"rawCommand": "324", | ||
"commandType": "reply", | ||
"args": ["nodebot", "#ubuntu", "+CLcntjf", "5:10", "#ubuntu-unregged"] | ||
} | ||
|
||
}, | ||
"433-before-001": { | ||
"sent": [ | ||
["NICK testbot", "Client sent NICK message"], | ||
["USER nodebot 8 * :nodeJS IRC client", "Client sent USER message"], | ||
["NICK testbot1", "Client sent proper response to 433 nickname in use message"], | ||
["QUIT :node-irc says goodbye", "Client sent QUIT message"] | ||
], | ||
|
||
"received": [ | ||
[":localhost 433 * testbot :Nickname is already in use.\r\n", "Received nick in use error"], | ||
[":localhost 001 testbot1 :Welcome to the Internet Relay Chat Network testbot\r\n", "Received welcome message"] | ||
], | ||
"clientInfo": [ | ||
"hostmask is as expected after 433", | ||
"nick is as expected after 433", | ||
"maxLineLength is as expected after 433" | ||
] | ||
} | ||
} |
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
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
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
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