   result = {}
   cmd = "./bin/dredd #{descriptionFile} http://localhost:#{PORT} -ed"
 
-  cli = exec(cmd, (err, stdout, stderr) ->
+  cli = exec cmd, (err, stdout, stderr) ->
     result.exitStatus = err?.code or null
     result.stdout = '' + stdout
     result.stderr = '' + stderr
-  )
-  cli.on('close', (code) ->
+
+  cli.on 'close', (code) ->
     result.exitStatus ?= code if code
-    cb(null, result)
-  )
+    cb null, result
 
 
 parseJSON = (body) ->
   return undefined unless body
   try
-    JSON.parse(body)
+    JSON.parse body
   catch
     body
 

{assert} = require('chai')
{exec} = require('child_process')
express = require 'express'
clone = require 'clone'


  # fail: POST /customers duration: 13ms
  # fail: body: At '/name' Invalid type: null (expected string)
  # body: At '/shoeSize' Invalid type: string (expected number)
  entries = entries.filter (entry, i) ->
    previousEntry = entries[i - 1]
    if entry.label is 'body' and previousEntry.label is 'fail'
      previousEntry.body += '\n' + entry.body
      return false
    return true

  # Re-arrange data from entries
  results = {summary: '', failures: [], bodies: [], schemas: []}
  for entry in entries
    switch entry.label
      when 'body' then results.bodies.push parseJSON entry.body
      when 'bodySchema' then results.schemas.push parseJSON entry.body
      when 'complete' then results.summary = entry.body
      when 'fail' then results.failures.push entry.body
  return results


describe 'Regression: Issue #319', ->
  results = undefined

  brickTypePayload =
