# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
# Issues & docs: https://github.com/kreuzberg-dev/alef
# frozen_string_literal: true

require 'kreuzberg'
require 'json'
require 'spec_helper'

RSpec.describe 'pdf' do
  it 'render_pdf_page_first: render_pdf_page_to_png: first page' do
    pdf_bytes = File.read("pdf/fake_memo.pdf").bytes
    result = Kreuzberg.render_pdf_page_to_png(pdf_bytes, 0)
    expect(result.length).to be >= 100

  end

  it 'render_pdf_page_out_of_range: render_pdf_page_to_png: page out of range' do
    expect {
      pdf_bytes = File.read("pdf/fake_memo.pdf").bytes
      Kreuzberg.render_pdf_page_to_png(pdf_bytes, 999)
    }.to raise_error(RuntimeError)
  end
end
