aboutsummaryrefslogtreecommitdiffstats
path: root/test/angular-mocksSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2011-10-17 16:56:56 -0700
committerMisko Hevery2011-11-14 16:39:31 -0800
commit48697a2b86dbb12ea8de64cc5fece7caf68b321e (patch)
tree1fa50659f0bb5de2640dea2a2e5bb5628f2bb14a /test/angular-mocksSpec.js
parent93b777c916ccff243c5a6080bf5f39860ac7bf39 (diff)
downloadangular.js-48697a2b86dbb12ea8de64cc5fece7caf68b321e.tar.bz2
refactor(injector): turn scope into a service
- turn scope into a $rootScope service. - injector is now a starting point for creating angular application. - added inject() method which wraps jasmine its/beforeEach/afterEach, and which allows configuration and injection of services. - refactor tests to use inject() where possible BREAK: - removed angular.scope() method
Diffstat (limited to 'test/angular-mocksSpec.js')
-rw-r--r--test/angular-mocksSpec.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/test/angular-mocksSpec.js b/test/angular-mocksSpec.js
index c2cffca6..205461af 100644
--- a/test/angular-mocksSpec.js
+++ b/test/angular-mocksSpec.js
@@ -226,11 +226,8 @@ 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');
- });
+ it('should rethrow exceptions', inject(function($exceptionHandler) {
+ expect(function() { $exceptionHandler('myException'); }).toThrow('myException');
+ }));
});
});