aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/system.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/system.js b/lib/system.js
index 98b3ea9c..7d9552e5 100644
--- a/lib/system.js
+++ b/lib/system.js
@@ -43,10 +43,11 @@ function System(faker) {
* @method faker.system.fileName
*/
this.fileName = function () {
- var str = faker.random.words() + "." + faker.system.fileExt();
- return str
- .toLowerCase()
- .replace(/\W/g, "_");
+ var str = faker.random.words();
+ str = str
+ .toLowerCase()
+ .replace(/\W/g, "_") + "." + faker.system.fileExt();;
+ return str;
};
/**
@@ -56,10 +57,12 @@ function System(faker) {
* @param {string} ext
*/
this.commonFileName = function (ext) {
- var str = faker.random.words() + "." + (ext || faker.system.commonFileExt());
- return str
- .toLowerCase()
- .replace(/\W/g, "_");
+ var str = faker.random.words();
+ str = str
+ .toLowerCase()
+ .replace(/\W/g, "_");
+ str += "." + (ext || faker.system.commonFileExt());
+ return str;
};
/**
@@ -190,7 +193,7 @@ function System(faker) {
* @method faker.system.filePath
*/
this.filePath = function () {
- return faker.fake("{{system.directoryPath}}/{{system.fileName}}");
+ return faker.fake("{{system.directoryPath}}/{{system.fileName}}.{{system.fileExt}}");
};
/**