aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVojta Jina2011-10-31 20:34:03 -0700
committerIgor Minar2011-11-30 11:17:23 -0500
commitafbe073121f13a23dc33a1d958c0a964029dc6ee (patch)
tree471cdface7115d066f3a0e6a6397bd24912a6cc8 /src
parent7b705df2b77bbd5e112b976a7a9630327aa77aca (diff)
downloadangular.js-afbe073121f13a23dc33a1d958c0a964029dc6ee.tar.bz2
feat(mock.$httpBackend): add verifyNoOutstandingRequest method
+ rename verifyExpectations to verifyNoOutstandingExpectation
Diffstat (limited to 'src')
-rw-r--r--src/angular-mocks.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/angular-mocks.js b/src/angular-mocks.js
index e2348f6b..4cf4236c 100644
--- a/src/angular-mocks.js
+++ b/src/angular-mocks.js
@@ -664,12 +664,18 @@ angular.module.ngMock.$HttpBackendProvider = function() {
}
};
- $httpBackend.verifyExpectations = function() {
+ $httpBackend.verifyNoOutstandingExpectation = function() {
if (expectations.length) {
throw Error('Unsatisfied requests: ' + expectations.join(', '));
}
};
+ $httpBackend.verifyNoOutstandingRequest = function() {
+ if (responses.length) {
+ throw Error('Unflushed requests: ' + responses.length);
+ }
+ };
+
$httpBackend.resetExpectations = function() {
expectations = [];
responses = [];