Skip to content

Commit

Permalink
instead of passing config, overwrite in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
askmike committed Jan 1, 2014
1 parent 36187f3 commit 2bc88e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 4 additions & 3 deletions core/candleStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ var fs = require('fs');
var lodash = require('lodash');
var async = require('async');
var _ = require('lodash');

var Store = function(config) {
config = config || require('./util').util.getConfig();

var config = require('./util').getConfig();

var Store = function() {
this.directory = config.history.directory;

//TODO(yin): Make this mockable, or mock the fs in tests.
Expand Down
7 changes: 2 additions & 5 deletions test/csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,8 @@ module.exports = {
fs.existsSync(TMPDIR) || fs.mkdirSync(TMPDIR);
async.compose(save, deflate)(CSVFILE, DATA, done);
timer = new Timer();
csv = new CSVStore({
history: {
directory: TMPDIR
}
});
csv = new CSVStore();
csv.directory = TMPDIR;
},
// runs after each test method invocation
tearDown: function (done) {
Expand Down

0 comments on commit 2bc88e7

Please sign in to comment.