Skip to content

Commit b41d9a3

Browse files
author
ashmothership
committed
Merge remote-tracking branch 'Marak/master'
2 parents 1238c8b + eef113c commit b41d9a3

File tree

6 files changed

+40
-13
lines changed

6 files changed

+40
-13
lines changed

.travis.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@
22
sudo: false
33
language: node_js
44
node_js:
5+
- "5"
6+
- "5.1"
7+
- "4"
8+
- "4.2"
9+
- "4.1"
10+
- "4.0"
11+
- "0.12"
512
- "0.11"
613
- "0.10"
7-
# meteor specific node version
8-
- "0.10.36"
9-
# - "0.8"
14+
- "0.8"
15+
- "0.6"
16+
- "iojs"
1017

1118
before_install:
1219
# Install meteor and spacejam, a meteor command line package tester

lib/fake.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ function Fake (faker) {
8686
params = parameters;
8787
}
8888

89-
var result = fn.call(this, params);
89+
var result;
90+
if (typeof params === "string" && params.length === 0) {
91+
result = fn.call(this);
92+
} else {
93+
result = fn.call(this, params);
94+
}
9095

9196
// replace the found tag with the returned fake value
9297
res = str.replace('{{' + token + '}}', result);

lib/finance.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ var Finance = function (faker) {
134134
}
135135
return symbol;
136136
}
137+
137138
}
138139

139140
module['exports'] = Finance;

lib/random.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,15 @@ function Random (faker, seed) {
189189
return faker.random.arrayElement(Object.keys(faker.locales));
190190
};
191191

192+
/**
193+
* alphaNumeric
194+
*
195+
* @method faker.random.alphaNumeric
196+
*/
197+
this.alphaNumeric = function alphaNumeric() {
198+
return faker.random.arrayElement(["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]);
199+
}
200+
192201
return this;
193202

194203
}

package.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "faker",
33
"description": "Generate massive amounts of fake contextual data",
4-
"version": "3.0.1",
4+
"version": "3.1.0",
55
"contributors": [
66
"Marak Squires <marak.squires@gmail.com>",
77
"Matthew Bergman <matt@novafabrica.com>"
@@ -18,21 +18,16 @@
1818
},
1919
"devDependencies": {
2020
"browserify": "5.11.1",
21-
"gulp": "3.8.8",
22-
"gulp-mustache": "0.4.0",
23-
"gulp-rename": "1.2.0",
24-
"gulp-uglify": "1.0.1",
25-
"jsdoc": "^3.4.0",
2621
"jshint": "0.9.0",
2722
"lodash": "^2.4.1",
2823
"mocha": "1.8.x",
2924
"node-minify": "*",
3025
"optimist": "0.3.5",
3126
"sinon": "1.4.2",
32-
"vinyl-transform": "0.0.1",
3327
"through2": "2.0.0",
34-
"ink-docstrap": "1.1.4"
28+
"vinyl-transform": "0.0.1"
3529
},
3630
"license": "MIT",
37-
"main": "index.js"
31+
"main": "index.js",
32+
"dependencies": {}
3833
}

test/finance.unit.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,14 @@ describe('finance.js', function () {
202202
assert.ok(currencyCode.match(/[A-Z]{3}/));
203203
});
204204
})
205+
206+
/*
207+
describe("bitcoinAddress()", function(){
208+
it("returns a random bitcoin address", function(){
209+
var bitcoinAddress = faker.finance.bitcoinAddress();
210+
211+
assert.ok(bitcoinAddress.match(/^[A-Z0-9.]{27,34}$/));
212+
});
213+
});
214+
*/
205215
});

0 commit comments

Comments
 (0)