spyOn explicitly checks to see that a method name to spy on was passed.

[finish #27689237]
This commit is contained in:
slackersoft
2014-12-16 13:21:48 -08:00
parent 7570bc422b
commit b4b3ac25a1
3 changed files with 17 additions and 0 deletions

View File

@@ -7,6 +7,15 @@ describe("SpyRegistry", function() {
}).toThrowError(/could not find an object/);
});
it("checks that a method name was passed", function() {
var spyRegistry = new j$.SpyRegistry(),
subject = {};
expect(function() {
spyRegistry.spyOn(subject);
}).toThrowError(/No method name supplied/);
});
it("checks for the existence of the method", function() {
var spyRegistry = new j$.SpyRegistry(),
subject = {};