fix:exceptionHandler mock: should not specify dependencies

also added a test for this mock service
This commit is contained in:
Igor Minar 2011-07-01 17:37:01 -07:00
parent 25a77c58c1
commit 30bd04feaa
2 changed files with 11 additions and 2 deletions

View file

@ -246,8 +246,8 @@ angular.service('$browser', function(){
*
* See {@link angular.mock} for more info on angular mocks.
*/
angular.service('$exceptionHandler', function(e) {
return function(e) {throw e;};
angular.service('$exceptionHandler', function() {
return function(e) { throw e;};
});

View file

@ -216,4 +216,13 @@ describe('mocks', function(){
});
});
describe('$exceptionHandler', function() {
it('should rethrow exceptions', function() {
var rootScope = angular.scope(),
exHandler = rootScope.$service('$exceptionHandler');
expect(function() { exHandler('myException') }).toThrow('myException');
});
});
});