vendor/assets/javascripts/angular-mocks.js in angularjs-rails-1.3.10 vs vendor/assets/javascripts/angular-mocks.js in angularjs-rails-1.3.14
- old
+ new
@@ -1,7 +1,7 @@
/**
- * @license AngularJS v1.3.10
+ * @license AngularJS v1.3.14
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, angular, undefined) {
@@ -2132,20 +2132,34 @@
if (window.jasmine || window.mocha) {
var currentSpec = null,
+ annotatedFunctions = [],
isSpecRunning = function() {
return !!currentSpec;
};
+ angular.mock.$$annotate = angular.injector.$$annotate;
+ angular.injector.$$annotate = function(fn) {
+ if (typeof fn === 'function' && !fn.$inject) {
+ annotatedFunctions.push(fn);
+ }
+ return angular.mock.$$annotate.apply(this, arguments);
+ };
+
(window.beforeEach || window.setup)(function() {
+ annotatedFunctions = [];
currentSpec = this;
});
(window.afterEach || window.teardown)(function() {
var injector = currentSpec.$injector;
+
+ annotatedFunctions.forEach(function(fn) {
+ delete fn.$inject;
+ });
angular.forEach(currentSpec.$modules, function(module) {
if (module && module.$$hashKey) {
module.$$hashKey = undefined;
}