Add test cases for special characters

This commit is contained in:
rnhmjoj 2015-09-28 04:14:21 +02:00
parent 6c3e6730e7
commit b5e051524a

View File

@ -17,10 +17,17 @@ describe 'modulo memes', ->
it "dovrebbe generare correttamente l'url dell'immagine", (done) -> it "dovrebbe generare correttamente l'url dell'immagine", (done) ->
questions = [ questions = [
"asjon meme fry, not sure if this works, or not" "asjon meme fry, not sure if this works, or not"
"asjon meme doge, special characters?, underscore_ dash-"
"asjon meme icanhas, i can has, Upper CaSes?"
]
replies = [
'http://memegen.link/fry/not-sure-if-this-works/or-not.jpg'
'http://memegen.link/doge/special-characters~q/underscore__-dash--.jpg'
'http://memegen.link/icanhas/i-can-has/upper-cases~q.jpg'
] ]
acc = 0 acc = 0
asjon.receive (e,l) -> asjon.receive (e,l) ->
l.join().should.equal 'http://memegen.link/fry/not-sure-if-this-works/or-not.jpg' l.join().should.equal replies[acc]
acc++ acc++
if acc is questions.length then done() if acc is questions.length then done()
questions.map (q) -> asjon.send q questions.map (q) -> asjon.send q