aboutsummaryrefslogtreecommitdiff
path: root/tests/xml
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-08-16 14:52:24 +0100
committerMichael Williamson <mike@zwobble.org>2015-08-16 14:54:50 +0100
commit93625f1557428915f7a68156e1edc95b9d849eae (patch)
treeb1851f8b49c0983c899b8ef33cbcb5ff8a3966d4 /tests/xml
parent578ff57e4b86c4b31268e8b22a401c7bfaa9fe1a (diff)
Write element attributes
Diffstat (limited to 'tests/xml')
-rw-r--r--tests/xml/writer.tests.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/xml/writer.tests.js b/tests/xml/writer.tests.js
index a2f52ed..a542dc3 100644
--- a/tests/xml/writer.tests.js
+++ b/tests/xml/writer.tests.js
@@ -26,6 +26,14 @@ describe('xml.writer', function() {
'<root><album><year/><song/></album></root>');
});
+ test('can write element attributes', function() {
+ var element = xml.element("root", {}, [
+ xml.element("album", {"title": "Everything in Transit"})
+ ]);
+ assertXmlString(element,
+ '<root><album title="Everything in Transit"/></root>');
+ });
+
test('can write text nodes', function() {
var element = xml.element("root", {}, [
xml.element("album", {}, [