describe('AscenderScript', function () {
  var AscenderScript = webfont.AscenderScript;

  var configuration = {
    key: 'ec2de397-11ae-4c10-937f-bf94283a70c1',
    families: ['AndyBold', 'Arial:bold,regular']
  };

  describe('load family and variations', function () {
    var fakeDomHelper = null,
        fakeOnReady = null,
        ascenderScript = null;

    beforeEach(function () {
      fakeDomHelper = {
        insertInto: jasmine.createSpy('insertInto'),
        createCssLink: jasmine.createSpy('createCssLink'),
        getProtocol: jasmine.createSpy('getProtocol').andReturn('http:')
      };

      fakeOnReady = jasmine.createSpy('onReady');

      ascenderScript = new AscenderScript(fakeDomHelper, configuration);
      ascenderScript.load(fakeOnReady);
    });

    it('should create the link correctly', function () {
      expect(fakeDomHelper.createCssLink).toHaveBeenCalledWith('http://webfonts.fontslive.com/css/ec2de397-11ae-4c10-937f-bf94283a70c1.css');
      expect(fakeDomHelper.insertInto.calls[0].args[0]).toEqual('head');
    });

    it('should parse variations correctly', function () {
      expect(ascenderScript.parseVariations('regular')).toEqual(['n4']);
      expect(ascenderScript.parseVariations('bold')).toEqual(['n7']);
      expect(ascenderScript.parseVariations('italic')).toEqual(['i4']);
      expect(ascenderScript.parseVariations('bolditalic')).toEqual(['i7']);
      expect(ascenderScript.parseVariations('regular,')).toEqual(['n4']);
      expect(ascenderScript.parseVariations('regular,bold')).toEqual(['n4', 'n7']);
      expect(ascenderScript.parseVariations('regular,,bold')).toEqual(['n4', 'n7']);
      expect(ascenderScript.parseVariations('n4,n7')).toEqual(['n4', 'n7']);
    });
  })
});

@@ -79,18 +79,45 @@
 erScript
+,%0A      Font = webfont.Font
 ;%0A
-
 %0A  var c
@@ -1076,32 +1076,257 @@
 ead');%0A    %7D);%0A%0A
+    it('should pass the fonts correctly', function () %7B%0A      expect(fakeOnReady).toHaveBeenCalledWith(%5B%0A        new Font('AndyBold', 'n4'),%0A        new Font('Arial', 'n7'),%0A        new Font('Arial', 'n4')%0A      %5D);%0A    %7D);%0A%0A
     it('should p
@@ -1893,32 +1893,32 @@
 (%5B'n4', 'n7'%5D);%0A
-
       expect(asc
@@ -1985,16 +1985,722 @@
 %0A    %7D);
+%0A%0A    it('should parse font families correctly', function () %7B%0A      expect(ascenderScript.parseFamilyAndVariations('Arial')).toEqual(%5Bnew Font('Arial')%5D);%0A      expect(ascenderScript.parseFamilyAndVariations('Arial:bold,regular')).toEqual(%5Bnew Font('Arial', 'n7'), new Font('Arial', 'n4')%5D);%0A      expect(ascenderScript.parseFamilyAndVariations('Arial:n4,n7')).toEqual(%5Bnew Font('Arial', 'n4'), new Font('Arial', 'n7')%5D);%0A    %7D);%0A%0A    it('should parse multiple font families correctly', function () %7B%0A      expect(ascenderScript.parseFamiliesAndVariations(%5B'Arial', 'Sans:n4,n7'%5D)).toEqual(%5B%0A        new Font('Arial', 'n4'),%0A        new Font('Sans', 'n4'),%0A        new Font('Sans', 'n7')%0A      %5D);%0A    %7D);
 %0A  %7D)%0A%7D)

Add more test to the Ascender module.