<commit_before>var renderDocsFactory = require('../../processors/render-docs');

var mockLog, mockTemplateFinder, mockTemplateEngine;

beforeEach(function() {
  mockLog = jasmine.createSpyObj('mockLog', ['silly', 'debug', 'info', 'warn', 'error']);
  // Uncomment this line if you are debugging and want to see the log messages
  //mockLog.debug.and.callFake(console.log);

  mockTemplateFinder = jasmine.createSpy('templateFinder').and.returnValue('SOME TEMPLATE');
  mockTemplateEngine = jasmine.createSpyObj('templateEngine', ['render']);
});

describe("render-docs", function() {

  it("should call the templateFinder for each doc", function() {
    var doc1 = {}, doc2 = {}, docs = [ doc1, doc2 ];
    var processor = renderDocsFactory(mockLog, mockTemplateFinder, mockTemplateEngine);
    processor.$process(docs);
    expect(mockTemplateFinder.calls.count()).toEqual(2);
    expect(mockTemplateFinder.calls.argsFor(0)).toEqual([doc1]);
    expect(mockTemplateFinder.calls.argsFor(1)).toEqual([doc2]);
  });
<commit_msg>test(renderDocsProcessor): use mockLog from dgeni<commit_after>var renderDocsFactory = require('../../processors/render-docs');

var mockLog, mockTemplateFinder, mockTemplateEngine;
var mockLog = require('dgeni/lib/mocks/log')(/* true */);

beforeEach(function() {
  mockTemplateFinder = jasmine.createSpy('templateFinder').and.returnValue('SOME TEMPLATE');
  mockTemplateEngine = jasmine.createSpyObj('templateEngine', ['render']);
});

describe("render-docs", function() {

  it("should call the templateFinder for each doc", function() {
    var doc1 = {}, doc2 = {}, docs = [ doc1, doc2 ];
    var processor = renderDocsFactory(mockLog, mockTemplateFinder, mockTemplateEngine);
    processor.$process(docs);
    expect(mockTemplateFinder.calls.count()).toEqual(2);
    expect(mockTemplateFinder.calls.argsFor(0)).toEqual([doc1]);
    expect(mockTemplateFinder.calls.argsFor(1)).toEqual([doc2]);
  });

{'fraction_non_alphanumeric': 0.16002071465561885, 'fraction_numerical': 0.009321595028482652, 'mean_word_length': 5.802816901408451, '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': '1774581', 'n_tokens_mistral': 581, 'n_tokens_neox': 593, 'n_words': 108}