Created
January 15, 2015 22:33
-
-
Save aepyornis/01d8124586e54647aa8c to your computer and use it in GitHub Desktop.
writeCSV-test-mocha
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var should = require('should'); | |
var util = require('../util'); | |
// var db = mongojs('mongodb://localhost:27017/test', ['jobs']); | |
describe('writeCSV', function(){ | |
this.timeout(20000); | |
before(function(done){ | |
util.writeCSV(['BuildingType', 'ExistingStories', 'OwnerName'], 'test3', {'CB': '304'}, function(){ | |
done(); | |
}); | |
}) | |
it('works on three variables', function(){ | |
var test_csv = fs.readFileSync('test3.csv').toString(); | |
var lines = test_csv.split(/\n/); | |
lines[0].should.eql('BuildingType,ExistingStories,OwnerName'); | |
var lineLength = lines[1].split(',').length; | |
lineLength.should.eql(3); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment