-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspec.js
More file actions
27 lines (23 loc) · 761 Bytes
/
spec.js
File metadata and controls
27 lines (23 loc) · 761 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
var specFun = jasmine.createSpy()
sharedExampleFor("foo", specFun)
describe("jasmineSharedExamples", function(){
describe("sharedExampleFor", function(){
it("sharedExampleFor registers the function to the right label", function(){
expect(sharedExamples["foo"]).toBe(specFun);
});
});
describe("itBehavesLike", function(){
describe("no arguments", function(){
itBehavesLike("foo");
it("calls the example", function(){
expect(specFun).toHaveBeenCalled();
});
});
describe("with arguments", function(){
itBehavesLike("foo", 1,2,3,4,5);
it("calls the example with arguments", function(){
expect(specFun).toHaveBeenCalledWith(1,2,3,4,5);
});
});
});
});