   # dispatch them to matching listeners.
   #
   # path - String directory full of Hubot scripts to load.
-  constructor: (path, name = "Hubot") ->
+  constructor: (path, name = "Hubot", brain = Robot.RedisBrain) ->
     @name        = name
-    @brain       = new Robot.Brain()
+    @brain       = new brain()
     @commands    = []
     @Response    = Robot.Response
     @listeners   = []

    clearInterval @saveInterval
    @save => @client.quit()

  # Merge keys loaded from redis against the in memory representation
  #
  # Returns nothing
  #
  # Caveats: Deeply nested structures don't merge well
  mergeData: (data) ->
    for k of (data or { })
      @data[k] = data[k]

class Robot.Message
  # Represents an incoming message from the chat.
  #

  # Redis connects to a environmental variable REDISTOGO_URL or
  # fallsback to localhost
  constructor: () ->
    super()

    info = Url.parse process.env.REDISTOGO_URL || 'redis://localhost:6379'
    @client = Redis.createClient(info.port, info.hostname)
