/* global describe, it, expect */

var expect = require('chai').expect;


describe('nodex-aaa-oauth2', function() {
  
  describe('package.json', function() {
    var json = require('../package.json');
    
    it('should have assembly metadata', function() {
      expect(json.assembly.namespace).to.equal('oauth2');
      
      expect(json.assembly.components).to.have.length(24);
      //expect(json.assembly.components).to.include('main');
    });
  });
  
  it('should throw if required', function() {
    expect(function() {
      var pkg = require('..');
    }).to.throw(Error).with.property('code', 'MODULE_NOT_FOUND');
  });
  
  /*
  it('should export manifest', function() {
    expect(source).to.be.an('object');
    expect(source['server']).to.be.a('function');
    expect(source['transactionstore']).to.be.a('function');
    expect(source['code/response']).to.be.a('function');
    expect(source['code/grant']).to.be.a('function');
    expect(source['token/response']).to.be.a('function');
  });
  
  describe('oauth2/code/response', function() {
    var response = source['code/response'];
    
    it('should be annotated', function() {
      expect(response['@implements']).to.equal('http://schema.modulate.io/js/aaa/oauth2/Response');
      expect(response['@type']).to.equal('code');
      expect(response['@singleton']).to.equal(undefined);
    });
  });
  */
  
});

@@ -377,9 +377,9 @@
 th(2
-4
+3
 );%0A 
@@ -618,24 +618,24 @@
 OT_FOUND');%0A
+
   %7D);%0A  %0A  /
@@ -635,754 +635,8 @@
 %0A  %0A
-  /*%0A  it('should export manifest', function() %7B%0A    expect(source).to.be.an('object');%0A    expect(source%5B'server'%5D).to.be.a('function');%0A    expect(source%5B'transactionstore'%5D).to.be.a('function');%0A    expect(source%5B'code/response'%5D).to.be.a('function');%0A    expect(source%5B'code/grant'%5D).to.be.a('function');%0A    expect(source%5B'token/response'%5D).to.be.a('function');%0A  %7D);%0A  %0A  describe('oauth2/code/response', function() %7B%0A    var response = source%5B'code/response'%5D;%0A    %0A    it('should be annotated', function() %7B%0A      expect(response%5B'@implements'%5D).to.equal('http://schema.modulate.io/js/aaa/oauth2/Response');%0A      expect(response%5B'@type'%5D).to.equal('code');%0A      expect(response%5B'@singleton'%5D).to.equal(undefined);%0A    %7D);%0A  %7D);%0A  */%0A  %0A
 %7D);%0A

Fix tests.