/* global describe, it, expect */

var factory = require('../app/service');


describe('service', function() {
  
  it('should export factory function', function() {
    expect(factory).to.be.a('function');
  });
  
  it('should be annotated', function() {
    expect(factory['@implements']).to.equal(undefined);
    expect(factory['@singleton']).to.equal(undefined);
  });
  
});

@@ -28,16 +28,83 @@
 ect */%0A%0A
+var expect = require('chai').expect;%0Avar sinon = require('sinon');%0A
 var fact
@@ -136,16 +136,50 @@
 vice');%0A
+var express = require('express');%0A
 %0A%0Adescri
@@ -413,66 +413,1361 @@
 ;%0A  
-  expect(factory%5B'@singleton'%5D).to.equal(undefined);%0A  %7D);
+%7D);%0A  %0A  describe('instantiating with multiple services', function(done) %7B%0A    var app;%0A    %0A    var service1 = new express.Router();%0A    var service2 = new express.Router();%0A    %0A    var service1Component = new Object();%0A    service1Component.create = sinon.stub().resolves(service1);%0A    service1Component.a = %7B '@path': '/beep' %7D;%0A    var service2Component = new Object();%0A    service2Component.create = sinon.stub().resolves(service2);%0A    service2Component.a = %7B '@path': '/boop' %7D;%0A    %0A    var container = new Object();%0A    container.components = sinon.stub()%0A    container.components.withArgs('http://i.bixbyjs.org/http/Service').returns(%5B%0A      service1Component,%0A      service2Component%0A    %5D);%0A    //container.create = sinon.stub()%0A    //container.create.withArgs('http://i.bixbyjs.org/http/Server').resolves(server);%0A    %0A    var logging = function(req, res, next)%7B%7D;%0A    var loggingMiddleware = sinon.stub().returns(logging);%0A    %0A    var logger = new Object();%0A    logger.notice = sinon.spy();%0A    logger.debug = sinon.spy();%0A    %0A    %0A    before(function(done) %7B%0A      factory(container, loggingMiddleware, logger).then(function(obj) %7B%0A        app = obj;%0A        done();%0A      %7D, done);%0A    %7D);%0A    %0A    it('should provide service', function() %7B%0A      expect(app).to.be.a('function');%0A    %7D);%0A  %7D); // instantiating with multiple services
 %0A  %0A

Add tests.