Permalink
Browse files

tests ok

  • Loading branch information...
1 parent ccb3025 commit 412a1ff12efabd9861037553b89f02dd97f926b5 @touv touv committed Nov 21, 2011
Showing with 29 additions and 0 deletions.
  1. +29 −0 test/element.js
View
@@ -0,0 +1,29 @@
+var XMLWriter = require('../');
+exports['setUp'] = function (callback) {
+ this.xw = new XMLWriter();
+ callback();
+};
+exports['t01'] = function (test) {
+ this.xw.startElement('foo');
+ test.equal(this.xw.toString(), '<foo/>');
+ test.done();
+};
+exports['t02'] = function (test) {
+ this.xw.startElement('foo');
+ this.xw.endElement();
+ test.equal(this.xw.toString(), '<foo/>');
+ test.done();
+};
+exports['t03'] = function (test) {
+ this.xw.startElement('foo');
+ this.xw.text('fake');
+ test.equal(this.xw.toString(), '<foo>fake</foo>');
+ test.done();
+};
+exports['t04'] = function (test) {
+ this.xw.startElement('foo');
+ this.xw.text('fake');
+ this.xw.endElement();
+ test.equal(this.xw.toString(), '<foo>fake</foo>');
+ test.done();
+};

0 comments on commit 412a1ff

Please sign in to comment.