diff options
| author | Vojta Jina | 2011-05-31 10:32:54 +0200 |
|---|---|---|
| committer | Vojta Jina | 2011-05-31 10:32:54 +0200 |
| commit | 2e5199997c77cb2febed4ff21bc12a5d5fbad4ce (patch) | |
| tree | da57107e2e07e5d160af0383cbd86ee2fbc94c80 /test/service | |
| parent | b2f5299e0e3d6e4892b7fcc37686012147bf0afa (diff) | |
| download | angular.js-2e5199997c77cb2febed4ff21bc12a5d5fbad4ce.tar.bz2 | |
Rename deprecated wasCalled() -> toHaveBeenCalled() in all specs
As well as wasNotCalled(), wasCalledWith(), wasNotCalledWith()
Diffstat (limited to 'test/service')
| -rw-r--r-- | test/service/deferSpec.js | 8 | ||||
| -rw-r--r-- | test/service/xhr.bulkSpec.js | 4 | ||||
| -rw-r--r-- | test/service/xhr.cacheSpec.js | 8 | ||||
| -rw-r--r-- | test/service/xhr.errorSpec.js | 2 | ||||
| -rw-r--r-- | test/service/xhrSpec.js | 2 |
5 files changed, 12 insertions, 12 deletions
diff --git a/test/service/deferSpec.js b/test/service/deferSpec.js index 8ac1b803..bd8fe7d7 100644 --- a/test/service/deferSpec.js +++ b/test/service/deferSpec.js @@ -43,10 +43,10 @@ describe('$defer', function() { var eval = this.spyOn(scope, '$eval').andCallThrough(); $defer(function() {}); - expect(eval).wasNotCalled(); + expect(eval).not.toHaveBeenCalled(); $browser.defer.flush(); - expect(eval).wasCalled(); + expect(eval).toHaveBeenCalled(); eval.reset(); //reset the spy; @@ -61,10 +61,10 @@ describe('$defer', function() { var eval = this.spyOn(scope, '$eval').andCallThrough(); $defer(function() {throw "Test Error";}); - expect(eval).wasNotCalled(); + expect(eval).not.toHaveBeenCalled(); $browser.defer.flush(); - expect(eval).wasCalled(); + expect(eval).toHaveBeenCalled(); }); it('should allow you to specify the delay time', function(){ diff --git a/test/service/xhr.bulkSpec.js b/test/service/xhr.bulkSpec.js index 89429a91..2990e666 100644 --- a/test/service/xhr.bulkSpec.js +++ b/test/service/xhr.bulkSpec.js @@ -57,10 +57,10 @@ describe('$xhr.bulk', function() { $xhrBulk.flush(function(){ log += 'DONE';}); $browserXhr.flush(); - expect($xhrError).wasCalled(); + expect($xhrError).toHaveBeenCalled(); var cb = $xhrError.mostRecentCall.args[0].callback; expect(typeof cb).toEqual($function); - expect($xhrError).wasCalledWith( + expect($xhrError).toHaveBeenCalledWith( {url:'/req1', method:'GET', data:null, callback:cb}, {status:404, response:'NotFound'}); diff --git a/test/service/xhr.cacheSpec.js b/test/service/xhr.cacheSpec.js index 0a0140a6..ecaebc3f 100644 --- a/test/service/xhr.cacheSpec.js +++ b/test/service/xhr.cacheSpec.js @@ -128,17 +128,17 @@ describe('$xhr.cache', function() { $browserXhr.expectGET('/url').respond('+'); cache('GET', '/url', null, callback); - expect(eval).wasNotCalled(); + expect(eval).not.toHaveBeenCalled(); $browserXhr.flush(); - expect(eval).wasCalled(); + expect(eval).toHaveBeenCalled(); eval.reset(); //reset the spy cache('GET', '/url', null, callback); - expect(eval).wasNotCalled(); + expect(eval).not.toHaveBeenCalled(); $browser.defer.flush(); - expect(eval).wasCalled(); + expect(eval).toHaveBeenCalled(); }); }); diff --git a/test/service/xhr.errorSpec.js b/test/service/xhr.errorSpec.js index da1b102e..bd9f7a92 100644 --- a/test/service/xhr.errorSpec.js +++ b/test/service/xhr.errorSpec.js @@ -29,7 +29,7 @@ describe('$xhr.error', function() { $browserXhr.flush(); var cb = $xhrError.mostRecentCall.args[0].callback; expect(typeof cb).toEqual($function); - expect($xhrError).wasCalledWith( + expect($xhrError).toHaveBeenCalledWith( {url:'/req', method:'POST', data:'MyData', callback:cb}, {status:500, body:'MyError'}); }); diff --git a/test/service/xhrSpec.js b/test/service/xhrSpec.js index 39bc1c66..ebcd90d4 100644 --- a/test/service/xhrSpec.js +++ b/test/service/xhrSpec.js @@ -60,7 +60,7 @@ describe('$xhr', function() { $xhr('GET', '/reqGET', null, function(){ throw "MyException"; }); $browserXhr.flush(); - expect($log.error).wasCalledWith("MyException"); + expect($log.error).toHaveBeenCalledWith("MyException"); }); |
