diff options
| author | Igor Minar | 2011-02-15 01:12:45 -0500 | 
|---|---|---|
| committer | Igor Minar | 2011-02-15 11:01:53 -0500 | 
| commit | 1777110958f76ee4be5760e36c96702223385918 (patch) | |
| tree | 5aa03b246507e66877e5eac69e58e004e244d7a5 /test/service/exceptionHandlerSpec.js | |
| parent | d2089a16335276eecb8d81eb17332c2dff2cf1a2 (diff) | |
| download | angular.js-1777110958f76ee4be5760e36c96702223385918.tar.bz2 | |
split up services into individual files
- split up services into files under src/service
- split up specs into files under test/service
- rewrite all specs so that they don't depend on one global forEach
- get rid of obsolete code and tests in ng:switch
- rename mock $log spec from "$log" to "$log mock"
Diffstat (limited to 'test/service/exceptionHandlerSpec.js')
| -rw-r--r-- | test/service/exceptionHandlerSpec.js | 23 | 
1 files changed, 23 insertions, 0 deletions
diff --git a/test/service/exceptionHandlerSpec.js b/test/service/exceptionHandlerSpec.js new file mode 100644 index 00000000..59349065 --- /dev/null +++ b/test/service/exceptionHandlerSpec.js @@ -0,0 +1,23 @@ +describe('$exceptionHandler', function() { +  var scope; + +  beforeEach(function(){ +    scope = angular.scope(); +  }); + + +  afterEach(function(){ +    dealoc(scope); +  }); + + +  it('should log errors', function(){ +    var scope = createScope({}, {$exceptionHandler: $exceptionHandlerFactory}, +                                {$log: $logMock}), +        $log = scope.$service('$log'), +        $exceptionHandler = scope.$service('$exceptionHandler'); + +    $exceptionHandler('myError'); +    expect($log.error.logs.shift()).toEqual(['myError']); +  }); +});  | 
