Skip to content

Commit

Permalink
test language/index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus committed Aug 2, 2016
1 parent de0737f commit 86fbe99
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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,
Expand Down Expand Up @@ -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);
});
Expand All @@ -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);
});
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 86fbe99

Please sign in to comment.