diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-08-16 14:35:22 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-08-16 14:35:22 +0100 |
| commit | 82d14072f95eb6112f7617c5dae8817f35aa93ea (patch) | |
| tree | 2f44813d21f0c45edd990ca9bf11d702230d4d77 | |
| parent | f41387191bbb87ecd38e05742d61dc663595c3d0 (diff) | |
Extract assertXmlString
| -rw-r--r-- | tests/xml/writer.tests.js | 10 |
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); +} |
