aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/xml/writer.tests.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/xml/writer.tests.js b/tests/xml/writer.tests.js
index 020e638..f2408e0 100644
--- a/tests/xml/writer.tests.js
+++ b/tests/xml/writer.tests.js
@@ -7,9 +7,13 @@ var test = require("../testing").test;
describe('xml.writer', function() {
test('writing empty root element writes out xml declaration and empty root element', function() {
- assert.equal(writer.writeString(new Element("root")),
- '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' +
- '<root/>');
+ assertXmlString(new Element("root"), '<root/>');
});
});
+
+function assertXmlString(element, expectedString) {
+ assert.equal(writer.writeString(element),
+ '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' +
+ expectedString);
+}