Permalink
Browse files

fixed tc error msgs

  • Loading branch information...
1 parent 2a5dc63 commit 9ec397e55e756e30e52a6bb02b7ce48ca4c03e16 @msuarz msuarz committed Sep 6, 2012
Showing with 16 additions and 3 deletions.
  1. +1 −1 package.json
  2. +15 −2 src/reports/teamcity.coffee
View
@@ -1,6 +1,6 @@
{
"name": "frankendoc",
- "version": "0.2.5",
+ "version": "0.2.6",
"description" : "bringing documents alive",
"repository" : { "type" : "git", "url" : "https://github.com/limadelic/frankendoc.git" },
"keywords" : ["testing", "atdd", "bdd"],
@@ -16,7 +16,8 @@ class @Report
stop_suite: (suite) ->
@report "SuiteFinished name='#{suite.name}' duration='#{suite.duration}'"
- running: (@name) ->
+ running: (name) ->
+ @name = @escape name
@stats.start()
@report "Started name='#{@name}'"
@@ -26,9 +27,21 @@ class @Report
failed: -> @report "Failed name='#{@name}' message='#{@message()}'"
pending: -> @report "Ignored name='#{@name}' message='#{@message()}'"
- message: -> _.escape @stats.messages().join '\n'
+ message: -> @escape @stats.messages().join '\n'
stop: ->
report: (message) ->
console.log '##teamcity[test' + message + ']'
+
+ escape: (s) -> s
+ .replace(/\|/g, "||")
+ .replace(/\n/g, "|n")
+ .replace(/\r/g, "|r")
+ .replace(/\[/g, "|[")
+ .replace(/\]/g, "|]")
+ .replace(/\u0085/g, "|x")
+ .replace(/\u2028/g, "|l")
+ .replace(/\u2029/g, "|p")
+ .replace(/'/g, "|'")
+

0 comments on commit 9ec397e

Please sign in to comment.