Add field test

This commit is contained in:
Tom MacWright 2012-12-19 17:34:34 -05:00
parent 78ea179c46
commit 180cd0cc6e

18
test/field.test.js Normal file
View File

@ -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]");
});
});
});