save point durring huge unorganized refactor

This commit is contained in:
Spencer Alger
2013-11-22 16:48:30 -07:00
parent 5bb70fbe58
commit 97ba084795
80 changed files with 46126 additions and 2410 deletions

View File

@ -0,0 +1,19 @@
var randomSelector = require('../../src/lib/selectors/random');
var _ = require('lodash');
describe('Random Selector', function () {
it('chooses a selection by random', function () {
var log = { a: 0, b: 0, c: 0 };
var choices = _.keys(log);
_.times(1000, function () {
var choice = randomSelector(choices);
log[choice]++;
});
_.filter(log, function (count) {
return count < 200 || count > 400;
}).should.have.length(0);
});
});