<commit_before># frozen_string_literal: true

require File.expand_path("../test_helper.rb", File.dirname(__FILE__))

describe Cairo::PDFSurface do
  it "is a subclass of Cairo::Surface" do
    _(Cairo::PDFSurface.superclass).must_equal Cairo::Surface
  end

  describe ".create" do
    before { @path = "test.pdf" }
    after  { File.delete(@path) if File.exist? @path }

    it "creates a new Cairo::PDFSurface" do
      obj = Cairo::PDFSurface.create(@path, 300, 200)
      _(obj).must_be_instance_of Cairo::PDFSurface
    end

    it "creates a new Cairo::PDFSurface with block" do
      called = nil
      Cairo::PDFSurface.create(@path, 300, 200) do |surface|
        _(surface).must_be_instance_of Cairo::PDFSurface
        called = true
      end
      refute_nil called
      assert File.exist?(@path)
    end
  end
end<commit_msg>Autocorrect Minitest/AssertPathExists<commit_after># frozen_string_literal: true

require File.expand_path("../test_helper.rb", File.dirname(__FILE__))

describe Cairo::PDFSurface do
  it "is a subclass of Cairo::Surface" do
    _(Cairo::PDFSurface.superclass).must_equal Cairo::Surface
  end

  describe ".create" do
    before { @path = "test.pdf" }
    after  { File.delete(@path) if File.exist? @path }

    it "creates a new Cairo::PDFSurface" do
      obj = Cairo::PDFSurface.create(@path, 300, 200)
      _(obj).must_be_instance_of Cairo::PDFSurface
    end

    it "creates a new Cairo::PDFSurface with block" do
      called = nil
      Cairo::PDFSurface.create(@path, 300, 200) do |surface|
        _(surface).must_be_instance_of Cairo::PDFSurface
        called = true
      end
      refute_nil called
      assert_path_exists(@path)
    end
  end
end
{'fraction_non_alphanumeric': 0.11104582843713279, 'fraction_numerical': 0.01410105757931845, 'mean_word_length': 3.377892030848329, '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': '4137901', 'n_tokens_mistral': 581, 'n_tokens_neox': 546, 'n_words': 139}