<commit_before>var ngdoc = require('../src/ngdoc.js');
var DOM = require('../src/dom.js').DOM;

describe('ngdoc', function() {
  var Doc = ngdoc.Doc;
  var dom;

  beforeEach(function() {
    dom = new DOM();
    this.addMatchers({
      toContain: function(text) {
        this.actual = this.actual.toString();
        return this.actual.indexOf(text) > -1;
      }
    });
  });

  describe('Doc', function() {
    describe('metadata', function() {

      it('should find keywords', function() {
        expect(new Doc('\nHello: World! @ignore. $abc').keywords()).toEqual('$abc hello world');
        expect(new Doc('The `ng:class-odd` and').keywords()).toEqual('and ng:class-odd the');
      });

      it('should get property and methods', function() {
        var doc = new Doc('Document');
        doc.properties.push(new Doc('Proprety'));
        doc.properties.push(new Doc('Method'));
        expect(doc.keywords()).toEqual('document method proprety');
      });

      it('should have shortName', function() {
        var d1 = new Doc('@name a.b.c').parse();
        var d2 = new Doc('@name a.b.ng-c').parse();
        var d3 = new Doc('@name some text: more text').parse();
        expect(ngdoc.metadata([d1])[0].shortName).toEqual('c');
        expect(ngdoc.metadata([d2])[0].shortName).toEqual('ng:c');
        expect(ngdoc.metadata([d3])[0].shortName).toEqual('more text');
      });

      it('should have depth information', function() {
        var d1 = new Doc('@name a.b.c').parse();
        var d2 = new Doc('@name a.b.ng-c').parse();
        var d3 = new Doc('@name some text: more text').parse();
        expect(ngdoc.metadata([d1])[0].depth).toEqual(2);
        expect(ngdoc.metadata([d2])[0].depth).toEqual(2);
        expect(ngdoc.metadata([d3])[0].depth).toEqual(1);
      });

    });

    describe('parse', function() {<commit_msg>fix(ngDocSpec): fix broken tests<commit_after>var ngdoc = require('../src/ngdoc.js');
var DOM = require('../src/dom.js').DOM;

describe('ngdoc', function() {
  var Doc = ngdoc.Doc;
  var dom;

  beforeEach(function() {
    dom = new DOM();
    this.addMatchers({
      toContain: function(text) {
        this.actual = this.actual.toString();
        return this.actual.indexOf(text) > -1;
      }
    });
  });

  describe('Doc', function() {
    describe('metadata', function() {

      it('should find keywords', function() {
        expect(new Doc('\nHello: World! @ignore. $abc').keywords()).toEqual('$abc hello world');
        expect(new Doc('The `ng:class-odd` and').keywords()).toEqual('and ng:class-odd the');
      });

      it('should get property and methods', function() {
        var doc = new Doc('Document');
        doc.properties.push(new Doc('Proprety'));
        doc.properties.push(new Doc('Method'));
        expect(doc.keywords()).toEqual('document method proprety');
      });

      it('should have shortName', function() {
        var d1 = new Doc('@name a.b.c').parse();
        var d2 = new Doc('@name a.b.ng-c').parse();
        var d3 = new Doc('@name some text: more text').parse();
        expect(ngdoc.metadata([d1])[0].shortName).toEqual('c');
        expect(ngdoc.metadata([d2])[0].shortName).toEqual('ng-c');
        expect(ngdoc.metadata([d3])[0].shortName).toEqual('more text');
      });

      it('should have depth information', function() {
        var d1 = new Doc('@name a.b.c').parse();
        var d2 = new Doc('@name a.b.ng-c').parse();
        var d3 = new Doc('@name some text: more text').parse();
        expect(ngdoc.metadata([d1])[0].depth).toEqual(2);
        expect(ngdoc.metadata([d2])[0].depth).toEqual(2);
        expect(ngdoc.metadata([d3])[0].depth).toEqual(1);
      });

    });

    describe('parse', function() {
{'fraction_non_alphanumeric': 0.2031040941932031, 'fraction_numerical': 0.011774150388011774, 'mean_word_length': 2.897810218978102, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7020738', 'n_tokens_mistral': 1199, 'n_tokens_neox': 1192, 'n_words': 237}