var vows = require("vows"),
    assert = require("assert"),
    topojson = require("../");

var suite = vows.describe("topojson.object");

suite.addBatch({
  "object": {
    "polygons are always closed, with at least four coordinates": function() {
      var topology = {
        type: "Topology",
        transform: {scale: [1, 1], translate: [0, 0]},
        objects: {polygon: {type: "Polygon", arcs: [[0]]}},
        arcs: [[[0, 0], [1, 1]]]
      };
      assert.deepEqual([[[0, 0], [1, 1], [0, 0], [0, 0]]], topojson.object(topology, topology.objects.polygon).coordinates);
    }
  }
});

suite.export(module);

@@ -364,23 +364,56 @@
 jects: %7B
-polygon
+foo: %7Btype: %22Polygon%22, arcs: %5B%5B0%5D%5D%7D, bar
 : %7Btype:
@@ -433,16 +433,19 @@
 rcs: %5B%5B0
+, 1
 %5D%5D%7D%7D,%0A  
@@ -470,16 +470,36 @@
 0%5D, %5B1, 
+1%5D%5D, %5B%5B1, 1%5D, %5B-1, -
 1%5D%5D%5D%0A   
@@ -606,23 +606,140 @@
 objects.
-polygon
+foo).coordinates);%0A      assert.deepEqual(%5B%5B%5B0, 0%5D, %5B1, 1%5D, %5B0, 0%5D, %5B0, 0%5D%5D%5D, topojson.object(topology, topology.objects.bar
 ).coordi

Combine tests.