var assert = require('assert');
describe('test mapper api', function() {
  it('should declare', function(done) {
    done();
  });
});
@@ -66,16 +66,33 @@
 ion() %7B%0A
+  var couchbase;%0A
   it('sh
@@ -127,16 +127,1338 @@
 ) %7B%0A    
+require('../main')().then(function(api) %7B%0A      couchbase = api;%0A      var test = couchbase.declare('test', %7B%0A        fields: %7B%0A          foo: %7B%0A            type: 'string',%0A            required: true,%0A            index: true%0A          %7D,%0A          bar: %7B%0A            type: 'number'%0A          %7D%0A        %7D%0A      %7D);%0A      // check the api%0A      assert(test.create instanceof Function);%0A      assert(test.find instanceof Function);%0A      assert(test.setup instanceof Function);%0A      assert(test.options.fields.foo.validate.type instanceof Function);%0A      assert(test.options.fields.foo.validate.contents instanceof Function);%0A      assert(test.options.type === 'test');%0A      // setup the couchbase server%0A      test.setup().then(function() %7B%0A        done();%0A      %7D).done();%0A    %7D).done();%0A  %7D);%0A  it('should create some data', function(done) %7B%0A    var entry = couchbase.get('test').create(%7B%0A      foo: 'oof', bar: 123%0A    %7D);%0A    assert(entry.foo === 'oof');%0A    assert(entry.bar === 123);%0A    assert(entry._id === false);%0A    entry.save().then(function() %7B%0A      assert(entry._id !== false, 'should have an ID');%0A      done();%0A    %7D).done();%0A  %7D);%0A  it('should find some data', function(done) %7B%0A    couchbase.get('test').find('foo', 'oof').then(function(results) %7B%0A      assert(results.length %3E 0);%0A      done();%0A    %7D).
 done();%0A

add tests over mapper