expect = require("chai").should() Asjon = require '../asjon-testing.coffee' asjon = undefined describe 'hubot mock', -> before (done) -> # Inizializzo robot Asjon (assa) -> asjon = assa after asjon.after afterEach asjon.clear require('../scripts/memoria.coffee')(asjon.robot) done() it 'should intercept hubot\'s HTTP calls', (done) -> asjon.robot.onHttp (method, addr, cb) -> addr.should.equal 'http://ddg.gg' method.should.equal 'GET' cb null, 200, 'mock body' asjon.robot.http('http://ddg.gg') .get() (err, res, body) -> if err then throw err res.should.equal 200 body.should.equal 'mock body' done()