[DRE-maint] Bug#1093922: ruby-file-validators: FTBFS: Failure/Error: require 'mimemagic'
Santiago Vila
sanvila at debian.org
Fri Jan 24 00:59:49 GMT 2025
Package: src:ruby-file-validators
Version: 3.0.0-2
Severity: serious
Tags: ftbfs trixie sid
Dear maintainer:
During a rebuild of all packages in unstable, your package failed to build:
--------------------------------------------------------------------------------
[...]
debian/rules clean
dh clean --buildsystem=ruby --with ruby
dh_auto_clean -O--buildsystem=ruby
dh_ruby --clean
W: XS-Ruby-Versions is deprecated, and will be ignored
dh_autoreconf_clean -O--buildsystem=ruby
dh_clean -O--buildsystem=ruby
debian/rules binary
dh binary --buildsystem=ruby --with ruby
dh_update_autotools_config -O--buildsystem=ruby
dh_autoreconf -O--buildsystem=ruby
dh_auto_configure -O--buildsystem=ruby
dh_ruby --configure
dh_auto_build -O--buildsystem=ruby
[... snipped ...]
is expected not to allow file size 10240 and #<ActiveModel::Validations::FileSizeValidator:0x00007fcdb4a35550 @attributes=[:avatar], @options={:less_than=>10240}>
as a proc
is expected to allow file size 9216 and #<ActiveModel::Validations::FileSizeValidator:0x00007fcdb49b0f80 @attributes=[:avatar], @options={:le...ile-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:107 (lambda)>}>
is expected not to allow file size 10240 and #<ActiveModel::Validations::FileSizeValidator:0x00007fcdb49dbf78 @attributes=[:avatar], @options={:le...ile-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:107 (lambda)>}>
with :greater_than and :less_than option
as a number
is expected to allow file size 7168 and #<ActiveModel::Validations::FileSizeValidator:0x00007fcdb433c668 @attributes=[:avatar], @options={:greater_than=>5120, :less_than=>10240}>
is expected not to allow file size 5120 and #<ActiveModel::Validations::FileSizeValidator:0x00007fcdb4363510 @attributes=[:avatar], @options={:greater_than=>5120, :less_than=>10240}>
is expected not to allow file size 10240 and #<ActiveModel::Validations::FileSizeValidator:0x00007fcdb42e6470 @attributes=[:avatar], @options={:greater_than=>5120, :less_than=>10240}>
as a proc
is expected to allow file size 7168 and #<ActiveModel::Validations::FileSizeValidator:0x00007fcdb426f640 @attributes=[:avatar], @options={:gr...ile-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:126 (lambda)>}>
is expected not to allow file size 5120 and #<ActiveModel::Validations::FileSizeValidator:0x00007fcdb429b1a0 @attributes=[:avatar], @options={:gr...ile-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:126 (lambda)>}>
is expected not to allow file size 10240 and #<ActiveModel::Validations::FileSizeValidator:0x00007fcdaffc9098 @attributes=[:avatar], @options={:gr...ile-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:126 (lambda)>}>
with :message option
is expected not to allow file size 11264, #<ActiveModel::Validations::FileSizeValidator:0x00007fcdb42512d0 @attributes=[:avatar], @options={:in=>5120..10240, :message=>"is invalid. (Between %{min} and %{max} please.)"}>, and {:message=>"Avatar is invalid. (Between 5 KB and 10 KB please.)"}
is expected to allow file size 7168, #<ActiveModel::Validations::FileSizeValidator:0x00007fcdaffb7050 @attributes=[:avatar], @options={:in=>5120..10240, :message=>"is invalid. (Between %{min} and %{max} please.)"}>, and {:message=>"Avatar is invalid. (Between 5 KB and 10 KB please.)"}
default error message
given :in options
is expected not to allow file size 11264, #<ActiveModel::Validations::FileSizeValidator:0x00007fcdaff79570 @attributes=[:avatar], @options={:in=>5120..10240}>, and {:message=>"Avatar file size must be between 5 KB and 10 KB"}
is expected not to allow file size 4096, #<ActiveModel::Validations::FileSizeValidator:0x00007fcdaff4d2e0 @attributes=[:avatar], @options={:in=>5120..10240}>, and {:message=>"Avatar file size must be between 5 KB and 10 KB"}
given :greater_than and :less_than options
is expected not to allow file size 11264, #<ActiveModel::Validations::FileSizeValidator:0x00007fcdaff71050 @attributes=[:avatar], @options={:greater_than=>5120, :less_than=>10240}>, and {:message=>"Avatar file size must be less than 10 KB"}
is expected not to allow file size 4096, #<ActiveModel::Validations::FileSizeValidator:0x00007fcdaff40130 @attributes=[:avatar], @options={:greater_than=>5120, :less_than=>10240}>, and {:message=>"Avatar file size must be greater than 5 KB"}
given :greater_than_or_equal_to and :less_than_or_equal_to options
is expected not to allow file size 11264, #<ActiveModel::Validations::FileSizeValidator:0x00007fcdaff19c10 @attributes=[:avatar], @options={:greater_than_or_equal_to=>5120, :less_than_or_equal_to=>10240}>, and {:message=>"Avatar file size must be less than or equal to 10 KB"}
is expected not to allow file size 4096, #<ActiveModel::Validations::FileSizeValidator:0x00007fcdafeea2a8 @attributes=[:avatar], @options={:greater_than_or_equal_to=>5120, :less_than_or_equal_to=>10240}>, and {:message=>"Avatar file size must be greater than or equal to 5 KB"}
exceptional file size
is expected to allow file size 0 and #<ActiveModel::Validations::FileSizeValidator:0x00007fcdafebc740 @attributes=[:avatar], @options={:less_than=>3072}>
is expected not to allow file size nil and #<ActiveModel::Validations::FileSizeValidator:0x00007fcdafecd838 @attributes=[:avatar], @options={:less_than=>3072}>
using the helper
adds the validator to the class
given options
raises argument error if no required argument was given
does not raise argument error if :less_than is numeric or a proc
raises error if :less_than is neither a number nor a proc
does not raise argument error if :less_than_or_equal_to is numeric or a proc
raises error if :less_than_or_equal_to is neither a number nor a proc
does not raise argument error if :greater_than is numeric or a proc
raises error if :greater_than is neither a number nor a proc
does not raise argument error if :greater_than_or_equal_to is numeric or a proc
raises error if :greater_than_or_equal_to is neither a number nor a proc
does not raise argument error if :in is a range or a proc
raises error if :in is neither a range nor a proc
Finished in 0.60114 seconds (files took 0.26352 seconds to load)
191 examples, 0 failures
/usr/bin/ruby3.3 /usr/bin/gem2deb-test-runner
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â Checking Rubygems dependency resolution on ruby3.3 â
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
RUBYLIB=. GEM_PATH=/<<PKGBUILDDIR>>/debian/ruby-file-validators/usr/share/rubygems-integration/all:/<<PKGBUILDDIR>>/debian/.debhelper/generated/_source/home/.local/share/gem/ruby/3.3.0:/var/lib/gems/3.3.0:/usr/local/lib/ruby/gems/3.3.0:/usr/lib/ruby/gems/3.3.0:/usr/lib/x86_64-linux-gnu/ruby/gems/3.3.0:/usr/share/rubygems-integration/3.3.0:/usr/share/rubygems-integration/all:/usr/lib/x86_64-linux-gnu/rubygems-integration/3.3.0 ruby3.3 -e gem\ \"file_validators\"
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â Run tests for ruby3.3 from debian/ruby-tests.rake â
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
RUBYLIB=. GEM_PATH=/<<PKGBUILDDIR>>/debian/ruby-file-validators/usr/share/rubygems-integration/all:/<<PKGBUILDDIR>>/debian/.debhelper/generated/_source/home/.local/share/gem/ruby/3.3.0:/var/lib/gems/3.3.0:/usr/local/lib/ruby/gems/3.3.0:/usr/lib/ruby/gems/3.3.0:/usr/lib/x86_64-linux-gnu/ruby/gems/3.3.0:/usr/share/rubygems-integration/3.3.0:/usr/share/rubygems-integration/all:/usr/lib/x86_64-linux-gnu/rubygems-integration/3.3.0 ruby3.3 -S rake --rakelibdir /gem2deb-nonexistent -f debian/ruby-tests.rake
/usr/bin/ruby3.3 -I/usr/share/rubygems-integration/all/gems/rspec-support-3.13.1/lib:/usr/share/rubygems-integration/all/gems/rspec-core-3.13.0/lib /usr/share/rubygems-integration/all/gems/rspec-core-3.13.0/exe/rspec --pattern ./spec/\*\*/\*_spec.rb --format documentation
Combined File Validators integration with ActiveModel
without helpers
with an allowed type
is expected to be valid
with a disallowed type
invalidates jpeg image file having size bigger than the allowed size
invalidates png image file
invalidates text file
with helpers
with an allowed type
is expected to be valid
with a disallowed type
invalidates jpeg image file having size bigger than the allowed size
invalidates png image file
invalidates text file
File Content Type integration with ActiveModel
:allow option
a string
with an allowed type
is expected to be valid
with a disallowed type
is expected not to be valid
as a regex
with an allowed types
validates jpeg image file
validates png image file
with a disallowed type
is expected not to be valid
as a list
with allowed types
validates jpeg
validates text file
with a disallowed type
is expected not to be valid
as a proc
with allowed types
validates jpeg
validates text file
with a disallowed type
is expected not to be valid
:exclude option
a string
with an allowed type
is expected to be valid
with a disallowed type
is expected not to be valid
as a regex
with an allowed type
is expected to be valid
with a disallowed types
invalidates jpeg image file
invalidates png image file
as a list
with an allowed type
is expected to be valid
with a disallowed types
invalidates jpeg
invalidates text file
as a proc
with an allowed type
is expected to be valid
with a disallowed types
invalidates jpeg image file
:allow and :exclude combined
with an allowed type
is expected to be valid
with a disallowed type
is expected not to be valid
:tool option
with valid file
validates the file
with spoofed file
invalidates the file
:mode option
strict mode
with valid file
validates the file
with spoofed file
invalidates the file
relaxed mode
with valid file
validates the file
with spoofed file
validates the file
default mode
with valid file
validates the file
with spoofed file
invalidates the file
image data as json string
for invalid content type
is expected not to be valid
for valid content type
is expected to be valid
empty json string
is expected to be valid
empty string
is expected to be valid
invalid json string
is expected not to be valid
image data as hash
for invalid content type
is expected not to be valid
for valid content type
is expected to be valid
empty hash
is expected to be valid
image data as array
for one invalid content type
is expected not to be valid
for two invalid content types
is invalid and adds just one error
for valid content type
is expected to be valid
empty array
is expected to be valid
File Size Validator integration with ActiveModel
:in option
as a range
when file size is out of range
is expected not to be valid
when file size is out of range
is expected not to be valid
when file size within range
is expected to be valid
as a proc
when file size is out of range
is expected not to be valid
when file size is out of range
is expected not to be valid
when file size within range
is expected to be valid
:greater_than and :less_than option
as numbers
when file size is out of range
is expected not to be valid
when file size is out of range
is expected not to be valid
when file size within range
is expected to be valid
as procs
when file size is out of range
is expected not to be valid
when file size is out of range
is expected not to be valid
when file size within range
is expected to be valid
:less_than_or_equal_to option
when file size is greater than the specified size
is expected not to be valid
when file size within the specified size
is expected to be valid
:greater_than_or_equal_to option
when file size is less than the specified size
is expected not to be valid
when file size within the specified size
is expected to be valid
:less_than option
when file size is greater than the specified size
is expected not to be valid
when file size within the specified size
is expected to be valid
:greater_than option
when file size is less than the specified size
is expected not to be valid
when file size within the specified size
is expected to be valid
image data as json string
when file size is less than the specified size
is expected not to be valid
when file size within the specified size
is expected to be valid
empty json string
is expected to be valid
empty string
is expected to be valid
invalid json string
is expected not to be valid
image data as hash
when file size is less than the specified size
is expected not to be valid
when file size within the specified size
is expected to be valid
empty hash
is expected to be valid
image data as array
when size of one file is less than the specified size
is expected not to be valid
when size of all files is within the specified size
is invalid and adds just one error
when size of all files is less than the specified size
is expected to be valid
one file
when file size is out of range
is expected not to be valid
when file size within range
is expected to be valid
empty array
is expected to be valid
FileValidators::MimeTypeAnalyzer
rises error when tool is invalid
:file analyzer
determines MIME type from file contents
returns text/plain for unidentified MIME types
is able to determine MIME type for spoofed files
is able to determine MIME type for non-files
returns nil for empty IOs
raises error if file command is not found
:fastimage analyzer
extracts MIME type of any IO
returns nil for unidentified MIME types
returns nil for empty IOs
:mimemagic analyzer
extracts MIME type of any IO (FAILED - 1)
returns nil for unidentified MIME types (FAILED - 2)
returns nil for empty IOs (FAILED - 3)
:marcel analyzer
extracts MIME type of any IO
returns application/octet-stream for unidentified MIME types
returns nil for empty IOs
:mime_types analyzer
extract MIME type from the file extension
extracts MIME type from file extension when IO is empty
returns nil on unknown extension
returns nil when input is not a file
:mini_mime analyzer
extract MIME type from the file extension
extracts MIME type from file extension when IO is empty
returns nil on unkown extension
returns nil when input is not a file
ActiveModel::Validations::FileContentTypeValidator
whitelist format
with an allowed type
as a string
is expected to allow file content type "image/jpg" and #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabcc41040 @attributes=[:avatar], @options={:allow=>"image/jpg"}>
as an regexp
is expected to allow file content type "image/png" and #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabca411a0 @attributes=[:avatar], @options={:allow=>/^image\/.*/}>
as a list
is expected to allow file content type "image/png" and #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabca54278 @attributes=[:avatar], @options={:allow=>["image/png", "image/jpg", "image/jpeg"]}>
as a proc
is expected to allow file content type "image/png" and #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabca69290 @attributes=[:avatar], @optio...idators-3.0.0/spec/lib/file_validators/validators/file_content_type_validator_spec.rb:34 (lambda)>}>
with a disallowed type
as a string
is expected not to allow file content type "image/jpeg" and #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabc9aabd8 @attributes=[:avatar], @options={:allow=>"image/png"}>
as a regexp
is expected not to allow file content type "image/png" and #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabc9ef468 @attributes=[:avatar], @options={:allow=>/^text\/.*/}>
as a proc
is expected not to allow file content type "image/png" and #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabca0cc70 @attributes=[:avatar], @optio...idators-3.0.0/spec/lib/file_validators/validators/file_content_type_validator_spec.rb:51 (lambda)>}>
with :message option
without interpolation
is expected not to allow file content type "image/jpeg", #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabc80e8d8 @attributes=[:avatar], @options={:allow=>"image/png", :message=>"should be a PNG image"}>, and {:message=>"Avatar should be a PNG image"}
with interpolation
is expected not to allow file content type "image/jpeg", #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabc82c400 @attributes=[:avatar], @options={:allow=>"image/png", :message=>"should have content type %{types}"}>, and {:message=>"Avatar should have content type image/png"}
is expected to allow file content type "image/png", #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabc77fe80 @attributes=[:avatar], @options={:allow=>"image/png", :message=>"should have content type %{types}"}>, and {:message=>"Avatar should have content type image/png"}
default message
is expected not to allow file content type "image/jpeg", #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabc773ef0 @attributes=[:avatar], @options={:allow=>"image/png"}>, and {:message=>"Avatar file should be one of image/png"}
blacklist format
with an allowed type
as a string
is expected to allow file content type "image/png" and #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabc7cd400 @attributes=[:avatar], @options={:exclude=>"image/gif"}>
as an regexp
is expected to allow file content type "image/png" and #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabc7c2668 @attributes=[:avatar], @options={:exclude=>/^text\/.*/}>
as a list
is expected to allow file content type "image/gif" and #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabc678ff0 @attributes=[:avatar], @options={:exclude=>["image/png", "image/jpg", "image/jpeg"]}>
as a proc
is expected to allow file content type "image/gif" and #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabc670350 @attributes=[:avatar], @optio...dators-3.0.0/spec/lib/file_validators/validators/file_content_type_validator_spec.rb:123 (lambda)>}>
with a disallowed type
as a string
is expected not to allow file content type "image/gif" and #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabc735240 @attributes=[:avatar], @options={:exclude=>"image/gif"}>
as an regexp
is expected not to allow file content type "text/plain" and #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabc75b238 @attributes=[:avatar], @options={:exclude=>/^text\/.*/}>
as an proc
is expected not to allow file content type "text/plain" and #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabc7fd0d8 @attributes=[:avatar], @optio...dators-3.0.0/spec/lib/file_validators/validators/file_content_type_validator_spec.rb:140 (lambda)>}>
with :message option
without interpolation
is expected not to allow file content type "image/png", #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabc7f07e8 @attributes=[:avatar], @options={:exclude=>"image/png", :message=>"should not be a PNG image"}>, and {:message=>"Avatar should not be a PNG image"}
with interpolation
is expected not to allow file content type "image/png", #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabc960ce0 @attributes=[:avatar], @options={:exclude=>"image/png", :message=>"should not have content type %{types}"}>, and {:message=>"Avatar should not have content type image/png"}
is expected to allow file content type "image/jpeg", #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabca1a348 @attributes=[:avatar], @options={:exclude=>"image/png", :message=>"should not have content type %{types}"}>, and {:message=>"Avatar should not have content type image/jpeg"}
default message
is expected not to allow file content type "image/png", #<ActiveModel::Validations::FileContentTypeValidator:0x00007feabca3c358 @attributes=[:avatar], @options={:exclude=>"image/png"}>, and {:message=>"Avatar file cannot be image/png"}
using the helper
adds the validator to the class
given options
raises argument error if no required argument was given
does not raise error if :allow is string, array, regexp or a proc
raises argument error if :allow is neither a string, array, regexp nor proc
does not raise error if :exclude is string, array, regexp or a proc
raises argument error if :exclude is neither a string, array, regexp nor proc
ActiveModel::Validations::FileSizeValidator
with :in option
as a range
is expected to allow file size 7168 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabccf4b18 @attributes=[:avatar], @options={:in=>5120..10240}>
is expected not to allow file size 4096 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabcd31d38 @attributes=[:avatar], @options={:in=>5120..10240}>
is expected not to allow file size 11264 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabca838c0 @attributes=[:avatar], @options={:in=>5120..10240}>
as a proc
is expected to allow file size 7168 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabcc01eb8 @attributes=[:avatar], @options={:in...file-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:38 (lambda)>}>
is expected not to allow file size 4096 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabcc21150 @attributes=[:avatar], @options={:in...file-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:38 (lambda)>}>
is expected not to allow file size 11264 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabca3b1d8 @attributes=[:avatar], @options={:in...file-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:38 (lambda)>}>
with :greater_than_or_equal_to option
as a number
is expected to allow file size 11264 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabca47050 @attributes=[:avatar], @options={:greater_than_or_equal_to=>10240}>
is expected to allow file size 10240 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabca5d878 @attributes=[:avatar], @options={:greater_than_or_equal_to=>10240}>
is expected not to allow file size 9216 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabca537b0 @attributes=[:avatar], @options={:greater_than_or_equal_to=>10240}>
as a proc
is expected to allow file size 11264 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc981490 @attributes=[:avatar], @options={:gr...file-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:56 (lambda)>}>
is expected to allow file size 10240 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc9a8400 @attributes=[:avatar], @options={:gr...file-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:56 (lambda)>}>
is expected not to allow file size 9216 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc9ef918 @attributes=[:avatar], @options={:gr...file-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:56 (lambda)>}>
with :less_than_or_equal_to option
as a number
is expected to allow file size 9216 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc7cc960 @attributes=[:avatar], @options={:less_than_or_equal_to=>10240}>
is expected to allow file size 10240 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc7c4d00 @attributes=[:avatar], @options={:less_than_or_equal_to=>10240}>
is expected not to allow file size 11264 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc7fd240 @attributes=[:avatar], @options={:less_than_or_equal_to=>10240}>
as a proc
is expected to allow file size 9216 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc7f11e8 @attributes=[:avatar], @options={:le...file-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:74 (lambda)>}>
is expected to allow file size 10240 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc8089d8 @attributes=[:avatar], @options={:le...file-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:74 (lambda)>}>
is expected not to allow file size 11264 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc67deb0 @attributes=[:avatar], @options={:le...file-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:74 (lambda)>}>
with :greater_than option
as a number
is expected to allow file size 11264 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc6742c0 @attributes=[:avatar], @options={:greater_than=>10240}>
is expected not to allow file size 10240 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc73e200 @attributes=[:avatar], @options={:greater_than=>10240}>
as a proc
is expected to allow file size 11264 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc733738 @attributes=[:avatar], @options={:gr...file-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:91 (lambda)>}>
is expected not to allow file size 10240 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc75b990 @attributes=[:avatar], @options={:gr...file-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:91 (lambda)>}>
with :less_than option
as a number
is expected to allow file size 9216 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc77c5f0 @attributes=[:avatar], @options={:less_than=>10240}>
is expected not to allow file size 10240 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc774288 @attributes=[:avatar], @options={:less_than=>10240}>
as a proc
is expected to allow file size 9216 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc7baf80 @attributes=[:avatar], @options={:le...ile-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:107 (lambda)>}>
is expected not to allow file size 10240 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc82c900 @attributes=[:avatar], @options={:le...ile-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:107 (lambda)>}>
with :greater_than and :less_than option
as a number
is expected to allow file size 7168 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc8221d0 @attributes=[:avatar], @options={:greater_than=>5120, :less_than=>10240}>
is expected not to allow file size 5120 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc8488a8 @attributes=[:avatar], @options={:greater_than=>5120, :less_than=>10240}>
is expected not to allow file size 10240 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabca0dd00 @attributes=[:avatar], @options={:greater_than=>5120, :less_than=>10240}>
as a proc
is expected to allow file size 7168 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabca1f898 @attributes=[:avatar], @options={:gr...ile-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:126 (lambda)>}>
is expected not to allow file size 5120 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabca15e60 @attributes=[:avatar], @options={:gr...ile-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:126 (lambda)>}>
is expected not to allow file size 10240 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabca86d40 @attributes=[:avatar], @options={:gr...ile-validators-3.0.0/spec/lib/file_validators/validators/file_size_validator_spec.rb:126 (lambda)>}>
with :message option
is expected not to allow file size 11264, #<ActiveModel::Validations::FileSizeValidator:0x00007feabcc08880 @attributes=[:avatar], @options={:in=>5120..10240, :message=>"is invalid. (Between %{min} and %{max} please.)"}>, and {:message=>"Avatar is invalid. (Between 5 KB and 10 KB please.)"}
is expected to allow file size 7168, #<ActiveModel::Validations::FileSizeValidator:0x00007feabcc49ba0 @attributes=[:avatar], @options={:in=>5120..10240, :message=>"is invalid. (Between %{min} and %{max} please.)"}>, and {:message=>"Avatar is invalid. (Between 5 KB and 10 KB please.)"}
default error message
given :in options
is expected not to allow file size 11264, #<ActiveModel::Validations::FileSizeValidator:0x00007feabca38dc0 @attributes=[:avatar], @options={:in=>5120..10240}>, and {:message=>"Avatar file size must be between 5 KB and 10 KB"}
is expected not to allow file size 4096, #<ActiveModel::Validations::FileSizeValidator:0x00007feabca41268 @attributes=[:avatar], @options={:in=>5120..10240}>, and {:message=>"Avatar file size must be between 5 KB and 10 KB"}
given :greater_than and :less_than options
is expected not to allow file size 11264, #<ActiveModel::Validations::FileSizeValidator:0x00007feabc84dba0 @attributes=[:avatar], @options={:greater_than=>5120, :less_than=>10240}>, and {:message=>"Avatar file size must be less than 10 KB"}
is expected not to allow file size 4096, #<ActiveModel::Validations::FileSizeValidator:0x00007feabc980c20 @attributes=[:avatar], @options={:greater_than=>5120, :less_than=>10240}>, and {:message=>"Avatar file size must be greater than 5 KB"}
given :greater_than_or_equal_to and :less_than_or_equal_to options
is expected not to allow file size 11264, #<ActiveModel::Validations::FileSizeValidator:0x00007feabc7bec70 @attributes=[:avatar], @options={:greater_than_or_equal_to=>5120, :less_than_or_equal_to=>10240}>, and {:message=>"Avatar file size must be less than or equal to 10 KB"}
is expected not to allow file size 4096, #<ActiveModel::Validations::FileSizeValidator:0x00007feabc7c77f8 @attributes=[:avatar], @options={:greater_than_or_equal_to=>5120, :less_than_or_equal_to=>10240}>, and {:message=>"Avatar file size must be greater than or equal to 5 KB"}
exceptional file size
is expected to allow file size 0 and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc7f6f08 @attributes=[:avatar], @options={:less_than=>3072}>
is expected not to allow file size nil and #<ActiveModel::Validations::FileSizeValidator:0x00007feabc67cd80 @attributes=[:avatar], @options={:less_than=>3072}>
using the helper
adds the validator to the class
given options
raises argument error if no required argument was given
does not raise argument error if :less_than is numeric or a proc
raises error if :less_than is neither a number nor a proc
does not raise argument error if :less_than_or_equal_to is numeric or a proc
raises error if :less_than_or_equal_to is neither a number nor a proc
does not raise argument error if :greater_than is numeric or a proc
raises error if :greater_than is neither a number nor a proc
does not raise argument error if :greater_than_or_equal_to is numeric or a proc
raises error if :greater_than_or_equal_to is neither a number nor a proc
does not raise argument error if :in is a range or a proc
raises error if :in is neither a range nor a proc
Failures:
1) FileValidators::MimeTypeAnalyzer :mimemagic analyzer extracts MIME type of any IO
Failure/Error: require 'mimemagic'
LoadError:
cannot load such file -- mimemagic
# ./lib/file_validators/mime_type_analyzer.rb:66:in `extract_with_mimemagic'
# ./lib/file_validators/mime_type_analyzer.rb:16:in `call'
# ./spec/lib/file_validators/mime_type_analyzer_spec.rb:68:in `block (3 levels) in <top (required)>'
2) FileValidators::MimeTypeAnalyzer :mimemagic analyzer returns nil for unidentified MIME types
Failure/Error: require 'mimemagic'
LoadError:
cannot load such file -- mimemagic
# ./lib/file_validators/mime_type_analyzer.rb:66:in `extract_with_mimemagic'
# ./lib/file_validators/mime_type_analyzer.rb:16:in `call'
# ./spec/lib/file_validators/mime_type_analyzer_spec.rb:72:in `block (3 levels) in <top (required)>'
3) FileValidators::MimeTypeAnalyzer :mimemagic analyzer returns nil for empty IOs
Failure/Error: require 'mimemagic'
LoadError:
cannot load such file -- mimemagic
# ./lib/file_validators/mime_type_analyzer.rb:66:in `extract_with_mimemagic'
# ./lib/file_validators/mime_type_analyzer.rb:16:in `call'
# ./spec/lib/file_validators/mime_type_analyzer_spec.rb:76:in `block (3 levels) in <top (required)>'
Finished in 0.34201 seconds (files took 0.24721 seconds to load)
191 examples, 3 failures
Failed examples:
rspec ./spec/lib/file_validators/mime_type_analyzer_spec.rb:67 # FileValidators::MimeTypeAnalyzer :mimemagic analyzer extracts MIME type of any IO
rspec ./spec/lib/file_validators/mime_type_analyzer_spec.rb:71 # FileValidators::MimeTypeAnalyzer :mimemagic analyzer returns nil for unidentified MIME types
rspec ./spec/lib/file_validators/mime_type_analyzer_spec.rb:75 # FileValidators::MimeTypeAnalyzer :mimemagic analyzer returns nil for empty IOs
/usr/bin/ruby3.3 -I/usr/share/rubygems-integration/all/gems/rspec-support-3.13.1/lib:/usr/share/rubygems-integration/all/gems/rspec-core-3.13.0/lib /usr/share/rubygems-integration/all/gems/rspec-core-3.13.0/exe/rspec --pattern ./spec/\*\*/\*_spec.rb --format documentation failed
ERROR: Test "ruby3.3" failed. Exiting.
dh_auto_install: error: dh_ruby --install /<<PKGBUILDDIR>>/debian/ruby-file-validators returned exit code 1
make: *** [debian/rules:7: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------
The above is just how the build ends and not necessarily the most relevant part.
If required, the full build log is available here:
https://people.debian.org/~sanvila/build-logs/202501/
About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.
If you could not reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.
If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:ruby-file-validators, so that this is still
visible in the BTS web page for this package.
Thanks.
More information about the Pkg-ruby-extras-maintainers
mailing list