/* global describe, it, expect */

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


describe('gateway', 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
@@ -137,16 +137,16 @@
 ways');%0A
-
 %0A%0Adescri
@@ -380,66 +380,768 @@
 ;%0A  
-  expect(factory%5B'@singleton'%5D).to.equal(undefined);%0A  %7D);
+%7D);%0A  %0A  describe('when app uses default gateway', function(done) %7B%0A    var gateways;%0A    %0A    var gateway = new Object();%0A    %0A    var container = new Object();%0A    container.components = sinon.stub()%0A    container.components.withArgs('http://i.bixbyjs.org/http/Gateway').resolves(%5B%5D);%0A    container.create = sinon.stub()%0A    container.create.withArgs('./gateway/http').resolves(gateway);%0A    %0A    before(function(done) %7B%0A      factory(container).then(function(obj) %7B%0A        gateways = obj;%0A        done();%0A      %7D, done);%0A    %7D);%0A    %0A    it('should provide gateways', function() %7B%0A      expect(gateways).to.be.an('array');%0A      expect(gateways).to.have.length(1);%0A      expect(gateways%5B0%5D).to.equal(gateway);%0A    %7D);%0A  %7D); // when app uses default gateway
 %0A  %0A

Add gateways tests.