diff options
author | James Lal <james@lightsofapollo.com> | 2012-06-19 14:25:16 -0700 |
---|---|---|
committer | James Lal <james@lightsofapollo.com> | 2012-06-19 14:25:16 -0700 |
commit | be947b56151b774d4b555097f2b8a8b4f47b633d (patch) | |
tree | 21552638cd7bf8ad1001edb128d3458a5887c8b4 | |
parent | fc8fc29ffbd335bfbcccee06f168e6c0408a20a1 (diff) | |
download | jsCalDAV-be947b56151b774d4b555097f2b8a8b4f47b633d.tar.gz |
Adding example of orphaning a tag
-rw-r--r-- | test/webcals/sax_test.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/webcals/sax_test.js b/test/webcals/sax_test.js index 71f6571..18a18a0 100644 --- a/test/webcals/sax_test.js +++ b/test/webcals/sax_test.js @@ -278,6 +278,17 @@ suite('webcals/sax', function() { ResponseHandler = Base.create({ name: 'response', + onopentag: function(data, handler) { + //if you don't want to append items + //to the object its fairly simple just + //orphan the tag. + if (data.tagSpec === 'DAV:/response') { + return this.current = {}; + } + + handler._super.onopentag.call(this, data, handler); + }, + handles: { 'DAV:/href': TextOnlyHandler, 'DAV:/status': TextOnlyHandler, @@ -322,7 +333,6 @@ suite('webcals/sax', function() { expectedResult = { complex: { - response: [{}, expectedEvent] } }; |