added tests and fixed meme. raised node listener limit (we got many tests)

This commit is contained in:
Enrico Fasoli 2015-09-26 18:14:55 +02:00
parent b77dd53523
commit 7405426dea
2 changed files with 9 additions and 3 deletions

View File

@ -3,6 +3,9 @@ path = require "path"
Robot = require("hubot/src/robot")
TextMessage = require("hubot/src/message").TextMessage
# Raise listeners limit
process.setMaxListeners(20)
before = (done) ->
process.env.TESTING_ASJON = 'true'
robot = new Robot null, "mock-adapter", no, 'asjon'

View File

@ -15,6 +15,9 @@ module.exports = (robot) ->
robot.respond /meme (.+)/i, (res) ->
text = res.match[1]
meme = (escape i.trim() for i in text.split ',').join '/'
url = 'http://memegen.link/' + meme + '.jpg'
res.send url
if(text.split(',').length != 3)
res.send 'richiesta malformata: prova a chiedermi "asjon help meme" per sapere sapere come funziona il comando'
else
meme = (escape i.trim() for i in text.split ',').join '/'
url = 'http://memegen.link/' + meme + '.jpg'
res.send url