<commit_before>require 'test_helper'

module Printers
  class LoanRegistryPrinterTest < Ekylibre::Testing::ApplicationControllerTestCase::WithFixtures
    setup do
      @template = Minitest::Mock.new
      @template.expect :nature, :loan_registry
      @template.expect :nature, Onoma::DocumentNature[:loan_registry]
      @template.expect :nil?, false
      @template.expect :managed?, true
    end

    teardown do
      @template.verify
    end

    test 'should print a loan registry' do
      printer = Printers::LoanRegistryPrinter.new(template: @template, stopped_on: Date.today.to_s)
      generator = Ekylibre::DocumentManagement::DocumentGenerator.build
      pdf_data = generator.generate_pdf(template: @template, printer: printer)
      assert pdf_data
    end
  end
end<commit_msg>Fix test on !1732<commit_after>require 'test_helper'

module Printers
  class LoanRegistryPrinterTest < Ekylibre::Testing::ApplicationControllerTestCase::WithFixtures
    setup do
      @template = Minitest::Mock.new
      @template.expect :nature, :loan_registry
      @template.expect :nature, Onoma::DocumentNature[:loan_registry]
      @template.expect :nil?, false
      @template.expect :managed?, true
    end

    teardown do
      @template.verify
    end

    test 'should print a loan registry' do
      printer = Printers::LoanRegistryPrinter.new(template: @template, started_on: (Date.today - 1.year).to_s, stopped_on: Date.today.to_s)
      generator = Ekylibre::DocumentManagement::DocumentGenerator.build
      pdf_data = generator.generate_pdf(template: @template, printer: printer)
      assert pdf_data
    end
  end
end
{'fraction_non_alphanumeric': 0.09241126070991432, 'fraction_numerical': 0.0030599755201958386, 'mean_word_length': 3.9847560975609757, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2136895', 'n_tokens_mistral': 489, 'n_tokens_neox': 468, 'n_words': 109}