From 5599b55b04788c2e327d7551a4a699d75516dd21 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Wed, 5 Jun 2013 15:30:31 -0700 Subject: refactor($route): pull $route and friends into angular-route.js $route, $routeParams and ngView have been pulled from core angular.js to angular-route.js/ngRoute module. This is was done to in order keep the core focused on most commonly used functionality and allow community routers to be freely used instead of $route service. There is no need to panic, angular-route will keep on being supported by the angular team. Note: I'm intentionally not fixing tutorial links. Tutorial will need bigger changes and those should be done when we update tutorial to 1.2. BREAKING CHANGE: applications that use $route will now need to load angular-route.js file and define dependency on ngRoute module. Before: ``` ... ... var myApp = angular.module('myApp', ['someOtherModule']); ... ``` After: ``` ... ... var myApp = angular.module('myApp', ['ngRoute', 'someOtherModule']); ... ``` Closes #2804 --- test/matchers.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/matchers.js') diff --git a/test/matchers.js b/test/matchers.js index 13d284e6..44d6b61e 100644 --- a/test/matchers.js +++ b/test/matchers.js @@ -190,3 +190,17 @@ jasmine.Matchers.prototype.toThrow = function(expected) { return result; }; + + +/** + * Create jasmine.Spy on given method, but ignore calls without arguments + * This is helpful when need to spy only setter methods and ignore getters + */ +function spyOnlyCallsWithArgs(obj, method) { + var spy = spyOn(obj, method); + obj[method] = function() { + if (arguments.length) return spy.apply(this, arguments); + return spy.originalValue.apply(this); + }; + return spy; +} -- cgit v1.2.3