Permalink
Browse files

Test null and undefined in `from.array`;

  • Loading branch information...
1 parent e81b908 commit 22156b6faab36f5ff83b24388282ad4f7bb4ce11 @wdavidw wdavidw committed Jan 1, 2013
Showing with 18 additions and 1 deletion.
  1. +18 −1 test/from.coffee
View
@@ -207,7 +207,24 @@ describe 'from', ->
csv()
.from.array(data, columns: ['id', 'counter'])
.to.string (data) ->
- console.log data.should.eql '250,0\n251,17\n252,0'
+ data.should.eql '250,0\n251,17\n252,0'
+ next()
+
+ it 'should handle null values', (next) ->
+ data = [[250, null], [251, 17], [252, null]]
+ csv()
+ .from.array(data, columns: ['id', 'counter'])
+ .to.string (data) ->
+ data.should.eql '250,\n251,17\n252,'
+ next()
+
+ it 'should handle undefined values', (next) ->
+ data = [[250, undefined], [251, 17], [252, undefined]]
+ csv()
+ .from.array(data, columns: ['id', 'counter'])
+ .to.string (data) ->
+ data.should.eql '250,\n251,17\n252,'
+ next()

0 comments on commit 22156b6

Please sign in to comment.