aboutsummaryrefslogtreecommitdiff
path: root/test/helpers.unit.js
diff options
context:
space:
mode:
authorSherman Mui <[email protected]>2015-06-04 11:43:49 -0700
committerSherman Mui <[email protected]>2015-06-04 11:43:49 -0700
commitaa242f7a4bf0cfd15ebcb7f5dcd799d27de6792b (patch)
tree49e461fef45f4d1f748cd2b9cf5e5ae0664a3564 /test/helpers.unit.js
parenta6c857f5b442d20182e64cf4f859e114d29a6786 (diff)
downloadfaker-aa242f7a4bf0cfd15ebcb7f5dcd799d27de6792b.tar.xz
faker-aa242f7a4bf0cfd15ebcb7f5dcd799d27de6792b.zip
Fix issue Marak/faker.js#214 with shuffle()
Add a dubious spec.
Diffstat (limited to 'test/helpers.unit.js')
-rw-r--r--test/helpers.unit.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/helpers.unit.js b/test/helpers.unit.js
index 425167e2..e58e04e7 100644
--- a/test/helpers.unit.js
+++ b/test/helpers.unit.js
@@ -21,6 +21,16 @@ describe("helpers.js", function () {
});
});
+ describe("shuffle()", function () {
+ it("the output is the same length as the input", function () {
+ sinon.spy(faker.random, 'number');
+ var shuffled = faker.helpers.shuffle(["a", "b"]);
+ assert.ok(shuffled.length === 2);
+ assert.ok(faker.random.number.calledWith(1));
+ faker.random.number.restore();
+ });
+ });
+
describe("slugify()", function () {
it("removes unwanted characters from URI string", function () {
assert.equal(faker.helpers.slugify("Aiden.HarÂȘann"), "Aiden.Harann");