Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (34 sloc) 1.203 kB
###
Test CSV - Copyright David Worms <open@adaltas.com> (BSD Licensed)
###
require 'coffee-script'
fs = require 'fs'
should = require 'should'
csv = if process.env.CSV_COV then require '../lib-cov/csv' else require '../src/csv'
describe 'buffer', ->
it 'Buffer smaller than in', (next) ->
csv()
.from.path "#{__dirname}/buffer/smaller.in",
bufferSize: 1024
.to.path("#{__dirname}/buffer/smaller.tmp")
.transform (record) ->
record.should.be.a 'object'
record
.on 'close', ->
expect = fs.readFileSync "#{__dirname}/buffer/smaller.out"
result = fs.readFileSync "#{__dirname}/buffer/smaller.tmp"
result.should.eql expect
fs.unlink "#{__dirname}/buffer/smaller.tmp", next
it 'Buffer same as in', (next) ->
csv()
.from.path "#{__dirname}/buffer/same.in",
bufferSize: 1024
.to.path("#{__dirname}/buffer/same.tmp")
.transform (record) ->
record.should.be.a 'object'
record
.on 'close', ->
expect = fs.readFileSync "#{__dirname}/buffer/same.out"
result = fs.readFileSync "#{__dirname}/buffer/same.tmp"
result.should.eql expect
fs.unlink "#{__dirname}/buffer/same.tmp", next
Jump to Line
Something went wrong with that request. Please try again.