github/hubot — pull request #714 by atmos (2014-06-12 23:37:26+00:00)
Title: Test adapter

This is useful for testing standalone scripts. It has a simple array to capture responses availables as `#history`.

It looks like this in your tests.

```coffeescript
Path = require("path")
Robot = require("hubot").Robot

pkg = require Path.join __dirname, "..", 'package.json'
testAdapter = Path.join(__dirname, "adapters")

Version = pkg.version

describe "The Hubot Script", () ->
robot = null
beforeEach () ->
robot = new Robot testAdapter, "test", false, "hubot"
robot.loadFile Path.join(__dirname, "..", "src"), "script.coffee"
robot.run()

afterEach () ->
robot.shutdown()

it "displays the version", () ->
robot.adapter.receiveText("hubot deploy:version")
expected = "hubot-deploy v#{Version}/hubot v2.7.5/node v0.10.21"
assert.equal expected, robot.adapter.history
```