Commit b9944a93 b9944a931abd6d3d16679f66daf398136c182e1d by Nicolas Perriault

fixed edge case in xunit export

1 parent 96e2707f
...@@ -72,6 +72,7 @@ XXXX-XX-XX, v1.0.1 ...@@ -72,6 +72,7 @@ XXXX-XX-XX, v1.0.1
72 - fixed [#336](https://github.com/n1k0/casperjs/issues/336) - Test result duration may have an exotic value 72 - fixed [#336](https://github.com/n1k0/casperjs/issues/336) - Test result duration may have an exotic value
73 - Added `casper.mouse.doubleclick()` 73 - Added `casper.mouse.doubleclick()`
74 - fixed [#343](https://github.com/n1k0/casperjs/issues/343) - Better script checks 74 - fixed [#343](https://github.com/n1k0/casperjs/issues/343) - Better script checks
75 - fixed an edge case with xunit export when `phantom.casperScript` may be not defined
75 76
76 2012-12-24, v1.0.0 77 2012-12-24, v1.0.0
77 ------------------ 78 ------------------
......
...@@ -45,7 +45,8 @@ var TestSuiteResult = require('tester').TestSuiteResult; ...@@ -45,7 +45,8 @@ var TestSuiteResult = require('tester').TestSuiteResult;
45 */ 45 */
46 function generateClassName(classname) { 46 function generateClassName(classname) {
47 "use strict"; 47 "use strict";
48 var script = classname.replace(phantom.casperPath, "").trim() || phantom.casperScript; 48 classname = (classname || "").replace(phantom.casperPath, "").trim();
49 var script = classname || phantom.casperScript || "";
49 if (script.indexOf(fs.workingDirectory) === 0) { 50 if (script.indexOf(fs.workingDirectory) === 0) {
50 script = script.substring(fs.workingDirectory.length + 1); 51 script = script.substring(fs.workingDirectory.length + 1);
51 } 52 }
......