aboutsummaryrefslogtreecommitdiff
path: root/test/system.unit.js
diff options
context:
space:
mode:
authorJakub Mandula <[email protected]>2017-02-26 13:51:40 +0000
committerJakub Mandula <[email protected]>2017-02-26 13:51:40 +0000
commit232a2a58d70935c57d311b5ba237347f703c2131 (patch)
tree69f695e62e17386988c47f8522bf5e14db193839 /test/system.unit.js
parentd6c20353360ef1eefb56128eeb50ece4f5845372 (diff)
parentf379057be0112d6732b056d93d1380be18e1087a (diff)
downloadfaker-232a2a58d70935c57d311b5ba237347f703c2131.tar.xz
faker-232a2a58d70935c57d311b5ba237347f703c2131.zip
Merge branch 'Mark/origin' into creditCard
Diffstat (limited to 'test/system.unit.js')
-rw-r--r--test/system.unit.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/system.unit.js b/test/system.unit.js
new file mode 100644
index 00000000..1edcb8be
--- /dev/null
+++ b/test/system.unit.js
@@ -0,0 +1,27 @@
+if (typeof module !== 'undefined') {
+ var assert = require('assert');
+ var sinon = require('sinon');
+ var faker = require('../index');
+}
+
+describe("system.js", function () {
+ describe("fileName()", function () {
+ it("returns filenames without system path seperators", function () {
+ sinon.stub(faker.random, 'words').returns('24/7');
+ var fileName = faker.system.fileName();
+ assert.equal(fileName.indexOf('/'), -1, 'generated fileNames should not have path seperators');
+
+ faker.random.words.restore();
+ });
+ });
+
+ describe("commonFileName()", function () {
+ it("returns filenames without system path seperators", function () {
+ sinon.stub(faker.random, 'words').returns('24/7');
+ var fileName = faker.system.commonFileName();
+ assert.equal(fileName.indexOf('/'), -1, 'generated commonFileNames should not have path seperators');
+
+ faker.random.words.restore();
+ });
+ });
+});