<commit_before>describe('TypekitScript', function () {
  var TypekitScript = webfont.TypekitScript;

  var configuration = {
    id: 'abc'
  };

  var fakeDomHelper = null,
      global = {},
      load = null,
      support = null;

  beforeEach(function () {
    global = {};

    support = jasmine.createSpy('support');

    load = jasmine.createSpy('load');

    fakeDomHelper = {
      insertInto: jasmine.createSpy('insertInto'),
      createScriptSrc: jasmine.createSpy('createScriptSrc'),
      getLoadWindow: jasmine.createSpy('getLoadWindow').andReturn(global),
      getProtocol: jasmine.createSpy('getProtocol').andReturn('http:')
    };
  });

  it('support load and life cycle', function () {
    var typekit = new TypekitScript(fakeDomHelper, configuration);

    typekit.supportUserAgent('useragent', support);

    expect(fakeDomHelper.insertInto.calls[0].args[0]).toEqual('head');
    expect(fakeDomHelper.createScriptSrc).toHaveBeenCalledWith('http://use.typekit.com/abc.js');
    expect(support).not.toHaveBeenCalled();

    expect(global.__webfonttypekitmodule__).not.toBeNull();
    expect(global.__webfonttypekitmodule__['abc']).not.toBeNull();

    global.__webfonttypekitmodule__['abc'](function (ua, config, init) {
      expect(ua).toEqual('useragent');
      expect(config).toEqual(configuration);
      expect(init).not.toBeNull();<commit_msg>Switch test suite to use.typekit.net<commit_after>describe('TypekitScript', function () {
  var TypekitScript = webfont.TypekitScript;

  var configuration = {
    id: 'abc'
  };

  var fakeDomHelper = null,
      global = {},
      load = null,
      support = null;

  beforeEach(function () {
    global = {};

    support = jasmine.createSpy('support');

    load = jasmine.createSpy('load');

    fakeDomHelper = {
      insertInto: jasmine.createSpy('insertInto'),
      createScriptSrc: jasmine.createSpy('createScriptSrc'),
      getLoadWindow: jasmine.createSpy('getLoadWindow').andReturn(global),
      getProtocol: jasmine.createSpy('getProtocol').andReturn('http:')
    };
  });

  it('support load and life cycle', function () {
    var typekit = new TypekitScript(fakeDomHelper, configuration);

    typekit.supportUserAgent('useragent', support);

    expect(fakeDomHelper.insertInto.calls[0].args[0]).toEqual('head');
    expect(fakeDomHelper.createScriptSrc).toHaveBeenCalledWith('http://use.typekit.net/abc.js');
    expect(support).not.toHaveBeenCalled();

    expect(global.__webfonttypekitmodule__).not.toBeNull();
    expect(global.__webfonttypekitmodule__['abc']).not.toBeNull();

    global.__webfonttypekitmodule__['abc'](function (ua, config, init) {
      expect(ua).toEqual('useragent');
      expect(config).toEqual(configuration);
      expect(init).not.toBeNull();
{'fraction_non_alphanumeric': 0.14817491868449584, 'fraction_numerical': 0.0014456089627755693, 'mean_word_length': 4.312859884836852, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '108898', 'n_tokens_mistral': 864, 'n_tokens_neox': 839, 'n_words': 117}