Nomad changes
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s

This commit is contained in:
Henrik Jess Nielsen
2026-06-01 23:40:55 +02:00
parent 72b1a0a6ed
commit b4c07d3693
5723 changed files with 1130655 additions and 0 deletions

47
e2e/ruby/spec/error_spec.rb generated Normal file
View File

@@ -0,0 +1,47 @@
# 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 'error' do
it 'error_empty_bytes: Graceful handling of empty bytes (should not error)' do
content = File.read("text/empty.txt").bytes
result = Kreuzberg.extract_bytes_sync(content, 'text/plain', Kreuzberg::ExtractionConfig.new())
expect(result).not_to be_nil
end
it 'error_empty_mime: Error when extracting with empty MIME type' do
expect {
content = File.read("text/plain.txt").bytes
Kreuzberg.extract_bytes_sync(content, '', Kreuzberg::ExtractionConfig.new())
}.to raise_error(RuntimeError)
end
it 'error_extract_bytes_conflicting_ocr: extract_bytes force+disable OCR' do
expect {
content = File.read("text/fake_text.txt").bytes
Kreuzberg.extract_bytes_sync(content, 'text/plain', Kreuzberg::ExtractionConfig.new(disable_ocr: true, force_ocr: true))
}.to raise_error(RuntimeError)
end
it 'error_invalid_mime_format: Error when extracting with invalid MIME type format' do
expect {
content = File.read("text/plain.txt").bytes
Kreuzberg.extract_bytes_sync(content, 'not-a-mime', Kreuzberg::ExtractionConfig.new())
}.to raise_error(RuntimeError)
end
it 'error_unsupported_mime: Error when extracting with unsupported MIME type' do
expect {
content = File.read("text/plain.txt").bytes
Kreuzberg.extract_bytes_sync(content, 'application/x-nonexistent', Kreuzberg::ExtractionConfig.new())
}.to raise_error(RuntimeError)
end
end