diff --git a/test/core/util.js b/test/core/util.js index 9be6f3d..c5d7f9d 100755 --- a/test/core/util.js +++ b/test/core/util.js @@ -102,7 +102,7 @@ .to.be.a('function'); }); - it('should return image type of URL in lower case', function () + it('should return extension of URL in lower case', function () { var imageType = PIXI.utils.getUrlFileExtension('http://foo.bar/baz.PNG'); @@ -110,6 +110,30 @@ .to.equal('png'); }); + it('should return extension of URL when absolute', function () + { + var imageType = PIXI.utils.getUrlFileExtension('/you/baz.PNG'); + + expect(imageType) + .to.equal('png'); + }); + + it('should return extension of URL when relative', function () + { + var imageType = PIXI.utils.getUrlFileExtension('me/baz.PNG'); + + expect(imageType) + .to.equal('png'); + }); + + it('should return extension of URL when just an extension', function () + { + var imageType = PIXI.utils.getUrlFileExtension('.PNG'); + + expect(imageType) + .to.equal('png'); + }); + it('should work with a hash on the url', function () { var imageType = PIXI.utils.getUrlFileExtension('http://foo.bar/baz.PNG#derp');