From ed36b9da3be338fe9eb36f3eeea901d6f51cd768 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Tue, 1 Nov 2011 21:09:54 -0700 Subject: refactor(injector): switch to injector 2.0 introduce modules --- test/service/locationSpec.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'test/service/locationSpec.js') diff --git a/test/service/locationSpec.js b/test/service/locationSpec.js index 38df2619..65ca36a7 100644 --- a/test/service/locationSpec.js +++ b/test/service/locationSpec.js @@ -308,13 +308,9 @@ describe('$location', function() { function initService(html5Mode, hashPrefix, supportHistory) { - return function(service){ - service('$locationConfig', function(){ - return {html5Mode: html5Mode, hashPrefix: hashPrefix}; - }); - service('$sniffer', function(){ - return {history: supportHistory}; - }); + return function($provide){ + $provide.value('$locationConfig', {html5Mode: html5Mode, hashPrefix: hashPrefix}); + $provide.value('$sniffer', {history: supportHistory}); }; } function initBrowser(url, basePath) { @@ -580,7 +576,7 @@ describe('$location', function() { var root, link, originalBrowser, lastEventPreventDefault; function configureService(linkHref, html5Mode, supportHist, attrs, content) { - return function(service){ + return function($provide){ var jqRoot = jqLite('
'); attrs = attrs ? ' ' + attrs + ' ' : ''; link = jqLite('' + content + '')[0]; @@ -588,9 +584,9 @@ describe('$location', function() { jqLite(document.body).append(jqRoot); - service('$document', function(){ return jqRoot; }); - service('$sniffer', function(){ return {history: supportHist}; }); - service('$locationConfig', function(){ return {html5Mode: html5Mode, hashPrefix: '!'}; }); + $provide.value('$document', jqRoot); + $provide.value('$sniffer', {history: supportHist}); + $provide.value('$locationConfig', {html5Mode: html5Mode, hashPrefix: '!'}); }; } -- cgit v1.2.3