Add unit tests to verify data integrity

This commit is contained in:
Andrew Miner
2015-03-25 19:11:19 -07:00
parent 351d84178d
commit 321cffcdcc
5 changed files with 52 additions and 1 deletions
@@ -17,6 +17,7 @@ module.exports = class CommandParserVersionBase
@_model = options.model
@_showAllErrors = options.showAllErrors
@errors = []
# Class Methods ################################################################################
@@ -38,6 +39,7 @@ module.exports = class CommandParserVersionBase
parse: (text)->
@_rawData = {}
@_lineNumber = 1
@errors = []
@_lines = text.split '\n'
@_lineNumber = 0
@@ -105,6 +107,7 @@ module.exports = class CommandParserVersionBase
catch e
e.message = "line #{@_lineNumber}: #{e.message}"
if not @_showAllErrors then throw e
@errors.push e
logger.error -> e.message
_parseHereDoc: (line)->