From 180cd0cc6ec3ce4ad59965d0c33c09c165e2a7fe Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Wed, 19 Dec 2012 17:34:34 -0500 Subject: [PATCH] Add field test --- test/field.test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/field.test.js diff --git a/test/field.test.js b/test/field.test.js new file mode 100644 index 0000000..66db99d --- /dev/null +++ b/test/field.test.js @@ -0,0 +1,18 @@ +var assert = require('assert'); +var tree = require('../lib/carto/tree.js'); +require('../lib/carto/tree/field'); + +describe('Field', function() { + describe('basic functionality', function() { + it('should be constructed', function() { + var f = new tree.Field("foo"); + assert.ok(f); + assert.equal(f.is, 'field'); + }); + it('should produce xml-friendly output', function() { + var f = new tree.Field("bar"); + assert.ok(f); + assert.equal(f.toString(), "[bar]"); + }); + }); +});