Commit 38d27611 38d276119c4125b174d78048907c7a1aaa0cfb7e by Nicolas Perriault

updated xunit tests to refect use of getSerializedXML

1 parent 113258a9
......@@ -159,6 +159,7 @@ XUnitExporter.prototype.getXML = function getXML() {
* @return string
*/
XUnitExporter.prototype.getSerializedXML = function getSerializedXML(xml) {
"use strict";
var serializer = new XMLSerializer();
return '<?xml version="1.0" encoding="UTF-8"?>' + serializer.serializeToString(this.getXML());
}
......
......@@ -7,7 +7,7 @@ casper.test.begin('XUnitReporter() initialization', 1, function suite(test) {
var xunit = require('xunit').create();
var results = new tester.TestSuiteResult();
xunit.setResults(results);
test.assertTruthy(xunit.getXML());
test.assertTruthy(xunit.getSerializedXML());
test.done();
});
......@@ -25,7 +25,7 @@ casper.test.begin('XUnitReporter() can hold test suites', 4, function suite(test
});
results.push(suite2);
xunit.setResults(results);
casper.start().setContent(xunit.getXML());
casper.start().setContent(xunit.getSerializedXML());
test.assertEvalEquals(function() {
return __utils__.findAll('testsuite').length;
}, 2);
......@@ -50,7 +50,7 @@ casper.test.begin('XUnitReporter() can hold a suite with a succesful test', 1, f
});
results.push(suite1);
xunit.setResults(results);
casper.start().setContent(xunit.getXML());
casper.start().setContent(xunit.getSerializedXML());
test.assertExists('testsuite[name="foo"][package="foo"][tests="1"][failures="0"] testcase[name="footext"]');
test.done();
});
......@@ -70,7 +70,7 @@ casper.test.begin('XUnitReporter() can handle a failed test', 2, function suite(
});
results.push(suite1);
xunit.setResults(results);
casper.start().setContent(xunit.getXML());
casper.start().setContent(xunit.getSerializedXML());
test.assertExists('testsuite[name="foo"][package="foo"][tests="1"][failures="1"] testcase[name="footext"] failure[type="footype"]');
test.assertEquals(casper.getElementInfo('failure[type="footype"]').text, 'footext');
test.done();
......