Skip to content

Commit f0b5385

Browse files
code style
1 parent 580605b commit f0b5385

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

packages/spanner/test/codec.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ describe('codec', function() {
4343
});
4444

4545
describe('SpannerDate', function() {
46+
it('should choke on multiple arguments', function() {
47+
var expectedErrorMessage = [
48+
'The spanner.date function accepts a Date object or a',
49+
'single argument parseable by Date\'s constructor.'
50+
].join(' ');
51+
52+
assert.throws(function() {
53+
new codec.SpannerDate(2012, 3, 21);
54+
}, new RegExp(expectedErrorMessage));
55+
});
56+
4657
it('should create an instance from a string', function() {
4758
var spannerDate = new codec.SpannerDate('08-20-1969');
4859
assert.strictEqual(spannerDate.value, '1969-08-20');
@@ -53,12 +64,6 @@ describe('codec', function() {
5364
var spannerDate = new codec.SpannerDate(date);
5465
assert.strictEqual(spannerDate.value, date.toJSON().replace(/T.+/, ''));
5566
});
56-
57-
it('should choke on multiple arguments', function() {
58-
assert.throws(function() {
59-
new codec.SpannerDate(2012, 3, 21);
60-
}, /The spanner\.date function accepts a Date object,/);
61-
});
6267
});
6368

6469
describe('Float', function() {

0 commit comments

Comments
 (0)