diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-08-16 14:32:53 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-08-16 14:32:53 +0100 |
| commit | f41387191bbb87ecd38e05742d61dc663595c3d0 (patch) | |
| tree | 090c852237421dee9c3088d0d5f95cc325afa70a /tests/xml | |
| parent | 9ff57bb770e0296bb2f5b7a41711c53954eb8c4e (diff) | |
Add writer for XML that can write out root nodes without attributes
Diffstat (limited to 'tests/xml')
| -rw-r--r-- | tests/xml/writer.tests.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/xml/writer.tests.js b/tests/xml/writer.tests.js new file mode 100644 index 0000000..020e638 --- /dev/null +++ b/tests/xml/writer.tests.js @@ -0,0 +1,15 @@ +var assert = require("assert"); + +var Element = require("../../lib/xml").Element; +var writer = require("../../lib/xml/writer"); +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/>'); + }); +}); + |
