@@ -119,10 +119,10 @@ describe('Bigtable/Row', function() {
119119 } ) ;
120120
121121 describe ( 'formatChunks_' , function ( ) {
122- var spy ;
122+ var formatFamiliesSpy ;
123123
124124 beforeEach ( function ( ) {
125- spy = sinon . stub ( Row , 'formatFamilies_' ) ;
125+ formatFamiliesSpy = sinon . stub ( Row , 'formatFamilies_' ) ;
126126 } ) ;
127127
128128 it ( 'should not include chunks without commitRow' , function ( ) {
@@ -131,13 +131,13 @@ describe('Bigtable/Row', function() {
131131 } ] ;
132132 var fakeFamilies = [ ] ;
133133
134- spy . returns ( fakeFamilies ) ;
134+ formatFamiliesSpy . returns ( fakeFamilies ) ;
135135
136136 var formatted = Row . formatChunks_ ( chunks ) ;
137137
138138 assert . strictEqual ( formatted , fakeFamilies ) ;
139- assert . strictEqual ( spy . callCount , 1 ) ;
140- assert . deepEqual ( spy . getCall ( 0 ) . args [ 0 ] , [ ] ) ;
139+ assert . strictEqual ( formatFamiliesSpy . callCount , 1 ) ;
140+ assert . deepEqual ( formatFamiliesSpy . getCall ( 0 ) . args [ 0 ] , [ ] ) ;
141141 } ) ;
142142
143143 it ( 'should ignore any chunks previous to a resetRow' , function ( ) {
@@ -155,14 +155,14 @@ describe('Bigtable/Row', function() {
155155 commitRow : true
156156 } ] ;
157157
158- spy . returns ( fakeFamilies ) ;
158+ formatFamiliesSpy . returns ( fakeFamilies ) ;
159159
160160 var formatted = Row . formatChunks_ ( chunks ) ;
161161
162162 assert . strictEqual ( formatted , fakeFamilies ) ;
163163 assert . strictEqual ( formatted . indexOf ( badData ) , - 1 ) ;
164- assert . strictEqual ( spy . callCount , 1 ) ;
165- assert . deepEqual ( spy . getCall ( 0 ) . args [ 0 ] , [ goodData ] ) ;
164+ assert . strictEqual ( formatFamiliesSpy . callCount , 1 ) ;
165+ assert . deepEqual ( formatFamiliesSpy . getCall ( 0 ) . args [ 0 ] , [ goodData ] ) ;
166166 } ) ;
167167 } ) ;
168168
@@ -193,11 +193,12 @@ describe('Bigtable/Row', function() {
193193
194194 it ( 'should format the families into a user-friendly format' , function ( ) {
195195 var formatted = Row . formatFamilies_ ( families ) ;
196-
197196 assert . deepEqual ( formatted , formattedRowData ) ;
198- assert . strictEqual ( FakeMutation . convertFromBytes . callCount , 2 ) ;
199- assert ( FakeMutation . convertFromBytes . getCall ( 0 ) . args [ 0 ] , 'test-column' ) ;
200- assert ( FakeMutation . convertFromBytes . getCall ( 1 ) . args [ 0 ] , 'test-value' ) ;
197+
198+ var convertStpy = FakeMutation . convertFromBytes ;
199+ assert . strictEqual ( convertStpy . callCount , 2 ) ;
200+ assert . strictEqual ( convertStpy . getCall ( 0 ) . args [ 0 ] , 'test-column' ) ;
201+ assert . strictEqual ( convertStpy . getCall ( 1 ) . args [ 0 ] , 'test-value' ) ;
201202 } ) ;
202203 } ) ;
203204
@@ -459,6 +460,7 @@ describe('Bigtable/Row', function() {
459460 it ( 'should provide the proper request options' , function ( done ) {
460461 row . parent . getRows = function ( reqOpts ) {
461462 assert . strictEqual ( reqOpts . key , ROW_ID ) ;
463+ assert . strictEqual ( reqOpts . filter , undefined ) ;
462464 assert . strictEqual ( FakeMutation . parseColumnName . callCount , 0 ) ;
463465 done ( ) ;
464466 } ;
@@ -565,6 +567,7 @@ describe('Bigtable/Row', function() {
565567
566568 row . get ( function ( err , row_ , apiResponse ) {
567569 assert ( err instanceof Row . RowError ) ;
570+ assert . strictEqual ( err . message , 'Unknown row: ' + row . id + '.' ) ;
568571 assert . deepEqual ( row_ , null ) ;
569572 assert . strictEqual ( response , apiResponse ) ;
570573 done ( ) ;
@@ -661,10 +664,10 @@ describe('Bigtable/Row', function() {
661664
662665 describe ( 'increment' , function ( ) {
663666 var COLUMN_NAME = 'a:b' ;
664- var spy ;
667+ var formatFamiliesSpy ;
665668
666669 beforeEach ( function ( ) {
667- spy = sinon . stub ( Row , 'formatFamilies_' ) . returns ( {
670+ formatFamiliesSpy = sinon . stub ( Row , 'formatFamilies_' ) . returns ( {
668671 a : {
669672 b : [ {
670673 value : 10
@@ -736,8 +739,8 @@ describe('Bigtable/Row', function() {
736739 assert . ifError ( err ) ;
737740 assert . strictEqual ( value , fakeValue ) ;
738741 assert . strictEqual ( apiResponse , response ) ;
739- assert . strictEqual ( spy . callCount , 1 ) ;
740- assert ( spy . calledWithExactly ( response . families ) ) ;
742+ assert . strictEqual ( formatFamiliesSpy . callCount , 1 ) ;
743+ assert ( formatFamiliesSpy . calledWithExactly ( response . families ) ) ;
741744 done ( ) ;
742745 } ) ;
743746 } ) ;
@@ -754,7 +757,7 @@ describe('Bigtable/Row', function() {
754757 }
755758 } ;
756759
757- Mutation . parseColumnName = sinon . spy ( function ( ) {
760+ var parseSpy = Mutation . parseColumnName = sinon . spy ( function ( ) {
758761 return {
759762 family : 'd' ,
760763 qualifier : 'e'
@@ -765,6 +768,7 @@ describe('Bigtable/Row', function() {
765768 assert . strictEqual ( entry . key , ROW_ID ) ;
766769 assert . deepEqual ( entry . data , expectedData ) ;
767770 assert . strictEqual ( entry . method , FakeMutation . methods . INSERT ) ;
771+ assert ( parseSpy . calledWithExactly ( key ) ) ;
768772 callback ( ) ;
769773 } ;
770774
0 commit comments