Skip to content

Commit

Permalink
Transform tests passing on Windows.
Browse files Browse the repository at this point in the history
Added a .gitattributes file to specify that the fixture data files should not have the line endings modified by git.
Fixed a couple of lint errors.
  • Loading branch information
petebacondarwin committed May 16, 2012
1 parent 05a9358 commit 472d6ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
11 changes: 6 additions & 5 deletions lib/commands/transform.js
Expand Up @@ -95,7 +95,8 @@ function IDStream(db, cacheNum) {
process.nextTick(function () {
that.emit('fetching', cacheNum);
});
};
}

util.inherits(IDStream, events.EventEmitter);

exports.createIDStream = function (db, cache) {
Expand Down Expand Up @@ -218,7 +219,7 @@ exports.clearIDs = function (db, source, target, options) {
rstream.pause();
}
i++;
if (i % 100 === 0 && i != 0) {
if (i % 100 === 0 && i !== 0) {
console.log('Transformed ' + i + ' docs');
}
});
Expand Down Expand Up @@ -294,7 +295,7 @@ exports.addIDs = function (db, source, target, options) {
rstream.resume();
}
i++;
if (i % 100 === 0 && i != 0) {
if (i % 100 === 0 && i !== 0) {
console.log('Transformed ' + i + ' docs');
}
});
Expand Down Expand Up @@ -393,7 +394,7 @@ exports.csv = function (db, source, target, options) {
csvfile.readStream.pause();
}
}
if (index % 100 === 0 && index != 0) {
if (index % 100 === 0 && index !== 0) {
console.log('Transformed ' + index + ' rows');
}
});
Expand Down Expand Up @@ -477,7 +478,7 @@ exports.map = function (db, source, target, options) {
omitted++;
}
i++;
if (i % 100 === 0 && i != 0) {
if (i % 100 === 0 && i !== 0) {
console.log('Transformed ' + i + ' docs');
}
});
Expand Down
7 changes: 4 additions & 3 deletions test/test-transform-csv.js
Expand Up @@ -4,16 +4,17 @@ var exec = require('child_process').exec,
fs = require('fs');


var bin = path.resolve(__dirname,'../bin/kanso');
var output = path.resolve(__dirname,'data-output');

exports.tearDown = function (callback) {
rimraf(path.resolve(__dirname,'data-output'), callback);
rimraf(output, callback);
};

function transformTest(trans, p) {
return function (test) {
var datadir = path.resolve(__dirname, p);
var datapath = path.resolve(datadir, 'data');
var bin = path.resolve(__dirname,'../bin/kanso');
var output = path.resolve(__dirname,'data-output');
var cmd = bin + ' transform ' + trans + ' ' + datapath + ' ' + output;

exec(cmd, function (err, stdout, stderr) {
Expand Down
1 change: 1 addition & 0 deletions test/testdata/.gitattributes
@@ -0,0 +1 @@
* eol=lf

0 comments on commit 472d6ba

Please sign in to comment.