[minor] manifestGather renaming.

This commit is contained in:
Paul Irish 2016-05-27 18:48:01 -07:00
Родитель 4ef58baae2
Коммит 0fc3808825
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 0556093828825272
1 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -17,9 +17,9 @@
/* eslint-env mocha */
const GathererClass = require('../../../src/gatherers/manifest');
const ManifestGather = require('../../../src/gatherers/manifest');
const assert = require('assert');
let Gatherer;
let manifestGather;
const isExpectedOutput = artifact => {
return 'raw' in artifact && 'value' in artifact;
@ -28,23 +28,23 @@ const isExpectedOutput = artifact => {
describe('Manifest gatherer', () => {
// Reset the Gatherer before each test.
beforeEach(() => {
Gatherer = new GathererClass();
manifestGather = new ManifestGather();
});
it('returns an artifact', () => {
return Gatherer.postProfiling({
return manifestGather.postProfiling({
driver: {
evaluateAsync() {
return Promise.resolve('');
}
}
}).then(_ => {
assert.ok(typeof Gatherer.artifact === 'object');
assert.ok(typeof manifestGather.artifact === 'object');
});
});
it('handles driver failure', () => {
return Gatherer.postProfiling({
return manifestGather.postProfiling({
driver: {
evaluateAsync() {
return Promise.reject('such a fail');
@ -53,13 +53,13 @@ describe('Manifest gatherer', () => {
}).then(_ => {
assert(false);
}).catch(_ => {
assert.ok(isExpectedOutput(Gatherer.artifact));
assert.ok(isExpectedOutput(manifestGather.artifact));
});
});
it('propagates error retrieving the manifest', () => {
const error = 'There was an error.';
return Gatherer.postProfiling({
return manifestGather.postProfiling({
driver: {
evaluateAsync() {
return Promise.resolve({
@ -68,7 +68,7 @@ describe('Manifest gatherer', () => {
}
}
}).then(_ => {
assert.ok(Gatherer.artifact.debugString === error);
assert.ok(manifestGather.artifact.debugString === error);
});
});
@ -76,7 +76,7 @@ describe('Manifest gatherer', () => {
const manifestContent = JSON.stringify({
name: 'App'
});
return Gatherer.postProfiling({
return manifestGather.postProfiling({
driver: {
evaluateAsync() {
return Promise.resolve({
@ -85,7 +85,7 @@ describe('Manifest gatherer', () => {
}
}
}).then(_ => {
assert.ok(typeof Gatherer.artifact.value === 'object');
assert.ok(typeof manifestGather.artifact.value === 'object');
});
});
});