1.0.1 • Published 10 years ago

testbot v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

TESTBOT

Writing your hubot script?

Make unit tests with TESTBOT.

It's easy.

npm

hubot

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