Skip to content

Commit

Permalink
test: System test fix (googleapis#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
muraliQlogic authored and JustinBeckwith committed Oct 15, 2018
1 parent cebd15a commit ac08dc7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Please use the format 'prezzy' or '${instance.name}/tables/prezzy'.`
* // }
* // }
*/
createPrefixRange(start) {
static createPrefixRange(start) {
const prefix = start.replace(new RegExp('[\xff]+$'), '');
let endKey = '';

Expand Down Expand Up @@ -297,7 +297,7 @@ Please use the format 'prezzy' or '${instance.name}/tables/prezzy'.`
'prefix should be used exclusively to ranges/start/end/prefixes.'
);
}
ranges.push(this.createPrefixRange(options.prefix));
ranges.push(Table.createPrefixRange(options.prefix));
}

if (options.prefixes) {
Expand All @@ -307,7 +307,7 @@ Please use the format 'prezzy' or '${instance.name}/tables/prezzy'.`
);
}
options.prefixes.forEach(prefix => {
ranges.push(this.createPrefixRange(prefix));
ranges.push(Table.createPrefixRange(prefix));
});
}

Expand Down
20 changes: 10 additions & 10 deletions test/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,39 +216,39 @@ describe('Bigtable/Table', function() {

describe('createPrefixRange', function() {
it('should create a range from the prefix', function() {
assert.deepStrictEqual(table.createPrefixRange('start'), {
assert.deepStrictEqual(Table.createPrefixRange('start'), {
start: 'start',
end: {
value: 'staru',
inclusive: false,
},
});

assert.deepStrictEqual(table.createPrefixRange('X\xff'), {
assert.deepStrictEqual(Table.createPrefixRange('X\xff'), {
start: 'X\xff',
end: {
value: 'Y',
inclusive: false,
},
});

assert.deepStrictEqual(table.createPrefixRange('xoo\xff'), {
assert.deepStrictEqual(Table.createPrefixRange('xoo\xff'), {
start: 'xoo\xff',
end: {
value: 'xop',
inclusive: false,
},
});

assert.deepStrictEqual(table.createPrefixRange('a\xffb'), {
assert.deepStrictEqual(Table.createPrefixRange('a\xffb'), {
start: 'a\xffb',
end: {
value: 'a\xffc',
inclusive: false,
},
});

assert.deepStrictEqual(table.createPrefixRange('com.google.'), {
assert.deepStrictEqual(Table.createPrefixRange('com.google.'), {
start: 'com.google.',
end: {
value: 'com.google/',
Expand All @@ -258,15 +258,15 @@ describe('Bigtable/Table', function() {
});

it('should create an inclusive bound when the prefix is empty', function() {
assert.deepStrictEqual(table.createPrefixRange('\xff'), {
assert.deepStrictEqual(Table.createPrefixRange('\xff'), {
start: '\xff',
end: {
value: '',
inclusive: true,
},
});

assert.deepStrictEqual(table.createPrefixRange(''), {
assert.deepStrictEqual(Table.createPrefixRange(''), {
start: '',
end: {
value: '',
Expand Down Expand Up @@ -653,7 +653,7 @@ describe('Bigtable/Table', function() {
});

afterEach(function() {
table.createPrefixRange.restore();
Table.createPrefixRange.restore();
});

it('should transform the prefix into a range', function(done) {
Expand All @@ -666,7 +666,7 @@ describe('Bigtable/Table', function() {
const fakePrefix = 'abc';

const prefixSpy = sinon
.stub(table, 'createPrefixRange')
.stub(Table, 'createPrefixRange')
.callsFake(function() {
return fakePrefixRange;
});
Expand Down Expand Up @@ -700,7 +700,7 @@ describe('Bigtable/Table', function() {
{start: 'def', end: 'deg'},
];
const prefixSpy = sinon
.stub(table, 'createPrefixRange')
.stub(Table, 'createPrefixRange')
.callsFake(function() {
const callIndex = prefixSpy.callCount - 1;
return prefixRanges[callIndex];
Expand Down

0 comments on commit ac08dc7

Please sign in to comment.