-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set the topic as the return of #toString() in tests.
[ci skip]
- Loading branch information
Fionn Kelleher
committed
Dec 20, 2013
1 parent
f96acdf
commit 6714dba
Showing
1 changed file
with
12 additions
and
12 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 |
---|---|---|
|
@@ -5,33 +5,33 @@ should = require("chai").should() | |
vows.describe("Converting parsed messages to strings").addBatch( | ||
"#toString() on parsed message": | ||
"with command only": | ||
topic: Message "FOO" | ||
topic: (Message "FOO").toString() | ||
"should return 'FOO'": (topic) -> | ||
topic.toString().should.equal "FOO" | ||
topic.should.equal "FOO" | ||
|
||
"with prefix, command": | ||
topic: Message ":test FOO" | ||
topic: (Message ":test FOO").toString() | ||
"should return ':test FOO'": (topic) -> | ||
topic.toString().should.equal ":test FOO" | ||
topic.should.equal ":test FOO" | ||
|
||
"with prefix, command, middle, trailing parameter": | ||
topic: Message ":[email protected] PRIVMSG #Test :This is a test" | ||
topic: (Message ":[email protected] PRIVMSG #Test :This is a test").toString() | ||
"should return ':[email protected] PRIVMSG #Test :This is a test'": (topic) -> | ||
topic.toString().should.equal ":[email protected] PRIVMSG #Test :This is a test" | ||
topic.should.equal ":[email protected] PRIVMSG #Test :This is a test" | ||
|
||
"with no prefix, command, middle, trailing with spaces": | ||
topic: Message "PRIVMSG #foo :This is a test" | ||
topic: (Message "PRIVMSG #foo :This is a test").toString() | ||
"should return 'PRIVMSG #foo :This is a test'": (topic) -> | ||
topic.toString().should.equal "PRIVMSG #foo :This is a test" | ||
topic.should.equal "PRIVMSG #foo :This is a test" | ||
|
||
"with multiple middle params, prefix": | ||
topic: Message ":test FOO bar baz quux" | ||
topic: (Message ":test FOO bar baz quux").toString() | ||
"should return ':test FOO bar baz quux'": (topic) -> | ||
topic.toString().should.equal ":test FOO bar baz quux" | ||
topic.should.equal ":test FOO bar baz quux" | ||
|
||
"with tags, prefix, command, middle params, trailing params": | ||
topic: Message "@test=super;single :[email protected] FOO bar baz quux :This is a test" | ||
topic: (Message "@test=super;single :[email protected] FOO bar baz quux :This is a test").toString() | ||
"should return '@test=super;single :[email protected] FOO bar baz quux :This is a test'": (topic) -> | ||
topic.toString().should.equal "@test=super;single :[email protected] FOO bar baz quux :This is a test" | ||
topic.should.equal "@test=super;single :[email protected] FOO bar baz quux :This is a test" | ||
|
||
).export(module) |