   it 'should assemble a prompt', (done) ->
     prompt = makePrompt ['a', 'b', 'c']
     prompt.build (err, result) ->
-      a = '\x1B[44m\x1B[37m a \x1B[0m'
-      b = '\x1B[42m\x1B[37m b \x1B[0m'
-      c = '\x1B[41m\x1B[39m c \x1B[0m'
-      result.should.equal "#{a}#{b}#{c}"
+      result.should.equal "#{expect.a}#{expect.b}#{expect.c}"
       done()
 
+  it 'should ignore empty sections', (done) ->
+    prompt = makePrompt ['a', 'empty', 'c']
+    prompt.build (err, result) ->
+      result.should.equal "#{expect.a}#{expect.c}"
+      done()
+
+  it 'should join sections with the same background with one space', (done) ->
+    prompt = makePrompt ['a', 'c', 'd']
+    prompt.build (err, result) ->
+      d = '\x1B[41m\x1B[37md \x1B[0m'
+      result.should.equal "#{expect.a}#{expect.c}#{d}"
+      done()
+
+  it 'should handle synchronous content functions', (done) ->
+    prompt = makePrompt ['b', 'hello', 'c']
+    prompt.build (err, result) ->
+      result.should.equal "#{expect.b}#{expect.hello}#{expect.c}"
+      done()
+
+  it 'should handle asynchronous content functions', (done) ->
+    prompt = makePrompt ['b', 'echo', 'c']
+    prompt.build (err, result) ->
+      result.should.equal "#{expect.b}#{expect.echo}#{expect.c}"
+      done()
+
+  it 'should handle multiple content inputs', (done) ->
+    prompt = makePrompt ['b', 'multi', 'c']
+    prompt.build (err, result) ->
+      result.should.equal "#{expect.b}#{expect.multi}#{expect.c}"
+      done()

      content: 'c'
      background: 'red'
      foreground: 'default'

  makePrompt = (keys) ->
    prompt = new Impromptu.Prompt



describe 'Prompt', ->
  helloSync = ->
    'Hello, world!'

  # Note: All module methods are handled asynchronously.
  methods = Impromptu.module.register ->
    @register 'hello', helloSync

    @register 'echo', (done) ->
      @exec "printf test", done

  sections =
    a:
      content: 'a'
