<commit_before>require 'test_helper'
require 'logger'
require 'stringio'

module Slim2pdf
  class WriterTest < Minitest::Test
    def setup
      @data = { title: 'Slim2pdf', content: 'Slim to PDF conversion gem' }
      @template = File.expand_path('../tpl/test.slim', __FILE__)
      @writer = Writer.new(@template, @data)
    end

    def test_init
      Writer.new
    end

    def test_initialize
      assert_equal @template, @writer.template
      assert_equal @data, @writer.data
    end

    def test_accessors
      writer = Writer.new
      writer.template = @template
      writer.data = @data
      assert_equal @template, writer.template
      assert_equal @data, writer.data
    end

    def test_render_to_html
      html = @writer.render_to_html
      assert_match %r{<title>Slim2pdf</title>}, html
      assert_match %r{<p>Slim to PDF conversion gem</p>}, html
    end
<commit_msg>Fix Minitest base class<commit_after>require 'test_helper'
require 'logger'
require 'stringio'

module Slim2pdf
  class WriterTest < MiniTest::Unit::TestCase
    def setup
      @data = { title: 'Slim2pdf', content: 'Slim to PDF conversion gem' }
      @template = File.expand_path('../tpl/test.slim', __FILE__)
      @writer = Writer.new(@template, @data)
    end

    def test_init
      Writer.new
    end

    def test_initialize
      assert_equal @template, @writer.template
      assert_equal @data, @writer.data
    end

    def test_accessors
      writer = Writer.new
      writer.template = @template
      writer.data = @data
      assert_equal @template, writer.template
      assert_equal @data, writer.data
    end

    def test_render_to_html
      html = @writer.render_to_html
      assert_match %r{<title>Slim2pdf</title>}, html
      assert_match %r{<p>Slim to PDF conversion gem</p>}, html
    end

{'fraction_non_alphanumeric': 0.09790979097909791, 'fraction_numerical': 0.0033003300330033004, 'mean_word_length': 2.90343347639485, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '310237', 'n_tokens_mistral': 577, 'n_tokens_neox': 570, 'n_words': 147}