namespace Tests @suite class XmlObjectTests extends Rooibos.BaseTestSuite @describe("XmlObject") @it("creates valid XML") function _() xml = new XmlObject() xml.Comment("This is a person.") if xml.Node("Person", { "name": `John "Joker" Doe`, "age": 30 }) xml.Comment("This is the address.") xml.EmptyNode("Address", { "street": "123 Main St", "city": "Anytown", "state": "NY" }) if xml.Node("Metadata") xml.TextNode("Data", "Some data") xml.End() end if xml.End() end if expected = `
Some data ` m.assertEqual(xml.ToXmlString(), expected) end function end class end namespace