
/**
 * WPCONN module
 */

var WPCONN = require('../');

/**
 * Package
 */

var pkg = require('../package.json');

/**
 * Testing data
 */

var wpapp = require('./data');

/**
 * WPCONN instance
 */

var wpconn = new WPCONN();

/**
 * Sync tests
 */

describe('version', function(){
  it('should have x.x.x format', function(){
    pkg.version.should.match(/\d\.\d\.\d/);
  });
});

describe('wp app', function(){
  it('`client id` should be a string of numbers', function(){
    (Number(wpapp.client_id)).should.be.a.Number;
  });

  it('`client secret` lenght and type', function(){
    wpapp.client_secret
      .should.be.an.instanceOf(String)
      .and.length(64);
  });

  it('`token` should be an String', function(){
    wpapp.token
      .should.be.an.instanceOf(String);
  });
});

/**
 * WPCONN object
 */

describe('WPCONN object', function(){
  it('should create a WPCONN object', function(){
    var wpconn = new WPCONN();
    wpconn.should.be.instanceof(WPCONN);
  });

  it('should set the token', function(){
    var wpconn = new WPCONN();
    var token = wpapp.token;
    wpconn.setToken(token);

    wpconn.token
      .should.be.ok
      .and.be.instanceOf(String)
      .eql(token);
  });
});

@@ -1197,20 +1197,348 @@
 l(token);%0A  %7D);%0A%7D);%0A
+%0A/**%0A * ME%0A */%0A%0Adescribe('me', function()%7B%0A  it('should get user object', function(done)%7B%0A    var wpconn = new WPCONN();%0A    var token = wpapp.token;%0A    wpconn.setToken(token);%0A%0A    wpconn.me(function(err, me)%7B%0A      if (err) throw err;%0A%0A      me.should.be.ok%0A      .and.an.instanceOf(Object);%0A%0A      done();%0A    %7D);%0A  %7D);%0A%7D);%0A

add async 'me' test