var expect = require('chai').expect;
var MObject = require('../lib/mobject');
var ObjectId = require('mongodb').ObjectId;

describe('MObject', function() {
  describe('new', function() {
    it('creates a new object id for itself when one isn\'t provided',
      function() {
      var mobj = new MObject();
      expect(mobj.id).to.be.an.instanceof(ObjectId);
    });
  });
});

@@ -361,16 +361,285 @@
 %0A    %7D);
+%0A%0A    it('sets the creation time to within a second of the object being created',%0A      function() %7B%0A      var mobj = new MObject();%0A      var now = new Date() / 1000;%0A      expect(mobj.created).to.be.gte(now - 1);%0A      expect(mobj.created).to.be.lte(now + 1);%0A    %7D);
 %0A  %7D);%0A%7D

test for MObj constructor time setting