testbot
v1.0.1
Published
helper for testing hubot-scripts
Downloads
7
Maintainers
Readme
TESTBOT
Writing your hubot script?
Make unit tests with TESTBOT
.
It's easy.
Usage
Write your test-cases like
Testbot = require 'testbot'
assert = require 'assert'
describe 'hubot', ->
bot = null
# create new bot before each test
beforeEach (done)->
bot = new Testbot
bot.load './src', ['hello.coffee'], done
# clear bot after each test
afterEach ->
do bot.clear
# write your test cases
describe 'hello', ->
it 'should send world', (done)->
bot.send 'hubot hello', (res)->
assert.equal res, "world"
do done
and run with mocha
$ mocha
hubot
hello
✓ should send world
1 passing (89ms)
Install
$ npm install testbot --save-dev