diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/ApiTest.js | 2 | ||||
| -rw-r--r-- | test/BrowserSpecs.js | 2 | ||||
| -rw-r--r-- | test/ParserTest.js | 28 | ||||
| -rw-r--r-- | test/ResourceSpec.js | 12 | ||||
| -rw-r--r-- | test/servicesSpec.js | 4 |
5 files changed, 10 insertions, 38 deletions
diff --git a/test/ApiTest.js b/test/ApiTest.js index 9f09773d..189e9ad6 100644 --- a/test/ApiTest.js +++ b/test/ApiTest.js @@ -8,7 +8,7 @@ ApiTest.prototype.testItShouldReturnTypeOf = function (){ assertEquals("string", angular.Object.typeOf("")); assertEquals("date", angular.Object.typeOf(new Date())); assertEquals("element", angular.Object.typeOf(document.body)); - assertEquals("function", angular.Object.typeOf(function(){})); + assertEquals($function, angular.Object.typeOf(function(){})); }; ApiTest.prototype.testItShouldReturnSize = function(){ diff --git a/test/BrowserSpecs.js b/test/BrowserSpecs.js index 99632928..47cabf0f 100644 --- a/test/BrowserSpecs.js +++ b/test/BrowserSpecs.js @@ -59,7 +59,7 @@ describe('browser', function(){ expect(head.scripts.length).toEqual(1); var url = head.scripts[0].src.split('?cb='); expect(url[0]).toEqual('http://example.org/path'); - expect(typeof window[url[1]]).toEqual('function'); + expect(typeof window[url[1]]).toEqual($function); window[url[1]]('data'); expect(log).toEqual('200:data;'); expect(typeof window[url[1]]).toEqual('undefined'); diff --git a/test/ParserTest.js b/test/ParserTest.js index d7fd2f94..8d690ecf 100644 --- a/test/ParserTest.js +++ b/test/ParserTest.js @@ -409,34 +409,6 @@ ParserTest.prototype.testMissingThrowsError = function() { } }; -ParserTest.prototype.testItShouldCreateClosureFunctionWithNoArguments = function () { - var scope = createScope(); - var fn = scope.$eval("{:value}"); - scope.$set("value", 1); - assertEquals(1, fn()); - scope.$set("value", 2); - assertEquals(2, fn()); - fn = scope.$eval("{():value}"); - assertEquals(2, fn()); -}; - -ParserTest.prototype.testItShouldCreateClosureFunctionWithArguments = function () { - var scope = createScope(); - scope.$set("value", 1); - var fn = scope.$eval("{(a):value+a}"); - assertEquals(11, fn(10)); - scope.$set("value", 2); - assertEquals(12, fn(10)); - fn = scope.$eval("{(a,b):value+a+b}"); - assertEquals(112, fn(10, 100)); -}; - -ParserTest.prototype.testItShouldHaveDefaultArugument = function(){ - var scope = createScope(); - var fn = scope.$eval("{:$*2}"); - assertEquals(4, fn(2)); -}; - ParserTest.prototype.testDoubleNegationBug = function (){ var scope = createScope(); assertEquals(true, scope.$eval('true')); diff --git a/test/ResourceSpec.js b/test/ResourceSpec.js index 546e9aec..1ac43d74 100644 --- a/test/ResourceSpec.js +++ b/test/ResourceSpec.js @@ -15,12 +15,12 @@ describe("resource", function() { }); it("should build resource", function(){ - expect(typeof CreditCard).toBe('function'); - expect(typeof CreditCard.get).toBe('function'); - expect(typeof CreditCard.save).toBe('function'); - expect(typeof CreditCard.remove).toBe('function'); - expect(typeof CreditCard['delete']).toBe('function'); - expect(typeof CreditCard.query).toBe('function'); + expect(typeof CreditCard).toBe($function); + expect(typeof CreditCard.get).toBe($function); + expect(typeof CreditCard.save).toBe($function); + expect(typeof CreditCard.remove).toBe($function); + expect(typeof CreditCard['delete']).toBe($function); + expect(typeof CreditCard.query).toBe($function); }); it('should default to empty parameters', function(){ diff --git a/test/servicesSpec.js b/test/servicesSpec.js index ffd01267..062ba8af 100644 --- a/test/servicesSpec.js +++ b/test/servicesSpec.js @@ -247,7 +247,7 @@ describe("service", function(){ scope.$xhr('POST', '/req', 'MyData', callback); xhr.flush(); var cb = $xhrError.mostRecentCall.args[0].callback; - expect(typeof cb).toEqual('function'); + expect(typeof cb).toEqual($function); expect($xhrError).wasCalledWith( {url:'/req', method:'POST', data:'MyData', callback:cb}, {status:500, body:'MyError'}); @@ -297,7 +297,7 @@ describe("service", function(){ expect($xhrError).wasCalled(); var cb = $xhrError.mostRecentCall.args[0].callback; - expect(typeof cb).toEqual('function'); + expect(typeof cb).toEqual($function); expect($xhrError).wasCalledWith( {url:'/req1', method:'GET', data:null, callback:cb}, {status:404, response:'NotFound'}); |
