Skip to content

Commit

Permalink
Set the topic as the return of #toString() in tests.
Browse files Browse the repository at this point in the history
[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.
24 changes: 12 additions & 12 deletions test/tostring.coffee
Expand Up @@ -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 ":test!me@test.ing PRIVMSG #Test :This is a test"
topic: (Message ":test!me@test.ing PRIVMSG #Test :This is a test").toString()
"should return ':test!me@test.ing PRIVMSG #Test :This is a test'": (topic) ->
topic.toString().should.equal ":test!me@test.ing PRIVMSG #Test :This is a test"
topic.should.equal ":test!me@test.ing 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 :test!me@test.ing FOO bar baz quux :This is a test"
topic: (Message "@test=super;single :test!me@test.ing FOO bar baz quux :This is a test").toString()
"should return '@test=super;single :test!me@test.ing FOO bar baz quux :This is a test'": (topic) ->
topic.toString().should.equal "@test=super;single :test!me@test.ing FOO bar baz quux :This is a test"
topic.should.equal "@test=super;single :test!me@test.ing FOO bar baz quux :This is a test"

).export(module)

0 comments on commit 6714dba

Please sign in to comment.