diff options
| -rw-r--r-- | lib/random.js | 2 | ||||
| -rw-r--r-- | test/lorem.unit.js | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/random.js b/lib/random.js index 78ef2383..7e8cca37 100644 --- a/lib/random.js +++ b/lib/random.js @@ -98,7 +98,7 @@ var random = { }, phone_codes: function () { - return faker.array_element(definitions.phone_codes); + return faker.random.array_element(definitions.phone_codes); }, domain_suffix: function () { return faker.random.array_element(definitions.domain_suffix); diff --git a/test/lorem.unit.js b/test/lorem.unit.js index f1b174d9..3d50679d 100644 --- a/test/lorem.unit.js +++ b/test/lorem.unit.js @@ -54,7 +54,7 @@ describe("lorem.js", function () { context("when 'wordCount' param passed in", function () { it("returns a string of at least the requested number of words", function () { sinon.spy(faker.Lorem, 'words'); - sinon.stub(faker.random, 'number').returns(2); + sinon.stub(faker.random, 'number').withArgs(7).returns(2); var sentence = faker.Lorem.sentence(10); assert.ok(typeof sentence === 'string'); @@ -70,7 +70,7 @@ describe("lorem.js", function () { context("when 'wordCount' and 'range' params passed in", function () { it("returns a string of at least the requested number of words", function () { sinon.spy(faker.Lorem, 'words'); - sinon.stub(faker.random, 'number').returnsArg(0); // it echos back its maximum possible value. + sinon.stub(faker.random, 'number').withArgs(4).returns(4); var sentence = faker.Lorem.sentence(10, 4); |
