-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathhexSpec.js
More file actions
27 lines (24 loc) · 784 Bytes
/
hexSpec.js
File metadata and controls
27 lines (24 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(function (Random) {
describe("hex", function () {
[{
upper: true,
pool: "0123456789ABCDEF"
}, {
upper: false,
pool: "0123456789abcdef"
}].forEach(function (o) {
var upper = o.upper;
var pool = o.pool;
describe("when upper = " + upper, function () {
it("returns the result of string with pool = '" + pool + "'", function () {
var length = 1337;
var dummy = function () {};
spyOn(Random, "string").andReturn(dummy);
var actual = Random.hex(upper);
expect(actual).toBe(dummy);
expect(Random.string).toHaveBeenCalledWith(pool);
});
});
});
});
}(typeof module !== "undefined" ? require("../lib/random") : Random));