define(['Chance', 'mocha', 'chai', 'underscore'], function (Chance, mocha, chai, _) {
    var expect = chai.expect;

    describe("Helpers", function () {
        var word, arr, picked, chance = new Chance();

        describe("capitalize works as expected", function () {
            it("returns a random name", function () {
                _(1000).times(function () {
                    word = chance.capitalize(chance.word());
                    expect(word).to.be.a('string');
                    expect(word[0]).to.match(/[A-Z]/);
                });
            });
        });

        describe("pick()", function () {
            it("returns a single element when called without a count argument", function () {
                arr = ['a', 'b', 'c', 'd'];
                _(1000).times(function () {
                    picked = chance.pick(arr);
                    expect(picked).to.have.length(1);
                });
            });

            it("returns multiple elements when called with a count argument", function () {
                arr = ['a', 'b', 'c', 'd'];
                _(1000).times(function () {
                    picked = chance.pick(arr, 3);
                    expect(picked).to.have.length(3);
                });
            });

            it("doesn't destroy the original array when called with a count argument", function () {
                arr = ['a', 'b', 'c', 'd', 'e', 'f'];
                _(1000).times(function () {
                    picked = chance.pick(arr, 3);
                    expect(arr).to.have.length(6);
                });
            });
        });

        describe("shuffle()", function () {
            it("returns an array of the same size", function () {
                arr = ['a', 'b', 'c', 'd', 'e'];
                _(1000).times(function () {
                    expect(chance.shuffle(_.clone(arr))).to.have.length(5);
                    expect(chance.shuffle(_.clone(arr))).to.contain('a');
                    var arr2 = _.clone(arr);
                    chance.shuffle(arr2);
                    expect(arr2).to.not.be.empty;
                });
            });
        });

        describe("pad()", function () {
            it("always returns same number when width same as the length of the number", function () {
                _(1000).times(function () {
                    var num = chance.natural({min: 10000, max: 99999});
                    expect(chance.pad(num, 5)).to.be.a('string');
                    expect(chance.pad(num, 5)).to.have.length(5);
                });
            });

            it("will pad a smaller number to the right width", function () {
                _(1000).times(function () {
                    var num = chance.natural({max: 99999});
                    expect(chance.pad(num, 10)).to.be.a('string');
                    expect(chance.pad(num, 10)).to.have.length(10);
                    expect(chance.pad(num, 10).indexOf('00000')).to.not.equal(-1);
                });
            });

            it("can specify pad element", function () {
                _(1000).times(function () {
                    var num = chance.natural({max: 99999});
                    expect(chance.pad(num, 10, 'V')).to.be.a('string');
                    expect(chance.pad(num, 10, 'V')).to.have.length(10);
                    expect(chance.pad(num, 10, 'V').indexOf('VVVVV')).to.not.equal(-1);
                });
            });
        });

    });
});

@@ -2129,32 +2129,1528 @@
 %0A            %7D);
+%0A%0A            it(%22returns a well shuffled array%22, function () %7B%0A                // See http://vq.io/1lEhbim checking it isn't doing that!%0A                arr = %5B'a', 'b', 'c', 'd', 'e'%5D;%0A                var positions = %7B%0A                    a: %5B0, 0, 0, 0, 0%5D,%0A                    b: %5B0, 0, 0, 0, 0%5D,%0A                    c: %5B0, 0, 0, 0, 0%5D,%0A                    d: %5B0, 0, 0, 0, 0%5D,%0A                    e: %5B0, 0, 0, 0, 0%5D%0A                %7D;%0A%0A                _(10000).times(function () %7B%0A                    arr = chance.shuffle(arr);%0A%0A                    // Accumulate the position of the a each time%0A                    arr.forEach(function(item, index) %7B%0A                        positions%5Bitem%5D%5Bindex%5D++;%0A                    %7D);%0A                %7D);%0A%0A                // Divide by the estimated number of a's which should appear in each%0A                // position%0A                _.forEach(positions, function(position, index) %7B%0A                    positions%5Bindex%5D = _.map(position, function(item) %7B%0A                        return item/10000;%0A                    %7D);%0A                %7D);%0A%0A                _.forEach(positions, function(position, index) %7B%0A                    _.forEach(position, function(item) %7B%0A                        // This should be around 20%25 give or take a bit since there are%0A                        // 5 elements and they should be evenly distributed%0A                        expect(item).to.be.within(0.18, 0.22);%0A                    %7D);%0A                %7D);%0A            %7D);
 %0A        %7D);%0A%0A  

Add test to ensure good distribution on shuffle() to satisfy issue #61