Remove the test-only ruby-filemagic dependency - #52
Merged
Merged
Conversation
Ruby 4.1 removed the legacy C APIs used by ruby-filemagic, causing Ruby-head CI to fail before the specs run. Assert exact downloaded bytes and recorded OCR text instead of using a MIME detector. Remove the unused libmagic setup from both workflows without changing production MIME detection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #50.
Ruby-head fails to install
ruby-filemagicbecause Ruby 4.1 removed the legacyData_Wrap_StructandData_Get_StructC APIs it uses. This dependency only supports two test assertions; production uploads already use Marcel.ruby-filemagicand its test-helper require.File.binreadof the fixture and the conversion response against the exact recorded OCR text, including its newline.Production MIME detection, cassettes, and recorded server error expectations are unchanged. Filename-based upload detection and request-body coverage remain separate follow-ups.
Verification
bundle exec rspec(29 examples, 0 failures) andbundle exec rubocoppass locally on:8d4efc1495, built from source using miseRuby 4.0.7 was tested with a fresh dependency resolution including Marcel 2.1.0; the same resolution also passes on Ruby-head. Ruby-head additionally passes with
CI=true, reporting 100% line coverage (146/146).The Ruby-head check uses a newer revision than the original failing CI job, and local checks ran on macOS arm64. The Linux CI matrix will provide the remaining validation.