diff --git a/test/index.js b/test/index.js index 86caac47bb95..6dfa173734a0 100644 --- a/test/index.js +++ b/test/index.js @@ -37,10 +37,13 @@ var FakeBigtable = createFakeApi(); var FakeCompute = createFakeApi(); var FakeDatastore = createFakeApi(); var FakeDNS = createFakeApi(); +var FakeLanguage = createFakeApi(); +var FakeLogging = createFakeApi(); var FakePrediction = createFakeApi(); var FakePubSub = createFakeApi(); var FakeResource = createFakeApi(); var FakeStorage = createFakeApi(); +var FakeTranslate = createFakeApi(); var FakeVision = createFakeApi(); describe('gcloud', function() { @@ -52,10 +55,13 @@ describe('gcloud', function() { mockery.registerMock('../lib/compute', FakeCompute); mockery.registerMock('../lib/datastore', FakeDatastore); mockery.registerMock('../lib/dns', FakeDNS); + mockery.registerMock('../lib/language', FakeLanguage); + mockery.registerMock('../lib/logging', FakeLogging); mockery.registerMock('../lib/prediction', FakePrediction); mockery.registerMock('../lib/pubsub', FakePubSub); mockery.registerMock('../lib/resource', FakeResource); mockery.registerMock('../lib/storage', FakeStorage); + mockery.registerMock('../lib/translate', FakeTranslate); mockery.registerMock('../lib/vision', FakeVision); mockery.enable({ useCleanCache: true, @@ -93,6 +99,14 @@ describe('gcloud', function() { assert.strictEqual(gcloud.dns, FakeDNS); }); + it('should export static language', function() { + assert.strictEqual(gcloud.language, FakeLanguage); + }); + + it('should export static logging', function() { + assert.strictEqual(gcloud.logging, FakeLogging); + }); + it('should export static prediction', function() { assert.strictEqual(gcloud.prediction, FakePrediction); }); @@ -109,6 +123,10 @@ describe('gcloud', function() { assert.strictEqual(gcloud.storage, FakeStorage); }); + it('should export static translate', function() { + assert.strictEqual(gcloud.translate, FakeTranslate); + }); + it('should export static vision', function() { assert.strictEqual(gcloud.vision, FakeVision); }); @@ -189,6 +207,24 @@ describe('gcloud', function() { }); }); + describe('language', function() { + it('should create a new Language', function() { + var language = localGcloud.language(options); + + assert(language instanceof FakeLanguage); + assert.strictEqual(language.calledWith_[0], options); + }); + }); + + describe('logging', function() { + it('should create a new Logging', function() { + var logging = localGcloud.logging(options); + + assert(logging instanceof FakeLogging); + assert.strictEqual(logging.calledWith_[0], options); + }); + }); + describe('prediction', function() { it('should create a new Prediction', function() { var prediction = localGcloud.prediction(options); @@ -225,6 +261,15 @@ describe('gcloud', function() { }); }); + describe('translate', function() { + it('should create a new Translate', function() { + var translate = localGcloud.translate(options); + + assert(translate instanceof FakeTranslate); + assert.strictEqual(translate.calledWith_[0], options); + }); + }); + describe('vision', function() { it('should create a new Vision', function() { var vision = localGcloud.vision(options);