rails / marcel

Find the mime type of files, examining file, filename and declared type
Apache License 2.0
386 stars 67 forks source link

single test failure when using rack 3 #91

Closed Apteryks closed 8 months ago

Apteryks commented 1 year ago

Hello,

In case it's useful, I'm building with rack 3, and there's a single test failure:

starting phase `check'
/tmp/guix-build-ruby-marcel-1.0.2.drv-0/source/test/test_helper.rb:36: warning: assigned but unused variable - extension
/tmp/guix-build-ruby-marcel-1.0.2.drv-0/source/test/mime_type_test.rb:22: warning: assigned but unused variable - content_type
Run options: --seed 37592

# Running:

....................................................................................................................................................................................................................................................................................................................................................................E....

Finished in 0.094140s, 3834.7065 runs/s, 3866.5738 assertions/s.

  1) Error:
Marcel::MimeTypeTest#test_gets_content_type_from_sources_that_conform_to_Rack::Lint::InputWrapper:
NameError: uninitialized constant Rack::Lint::InputWrapper
    /tmp/guix-build-ruby-marcel-1.0.2.drv-0/source/test/mime_type_test.rb:43:in `block in <class:MimeTypeTest>'

361 runs, 364 assertions, 0 failures, 1 errors, 0 skips
rake aborted!
Command failed with status (1)

Tasks: TOP => default => test
(See full trace by running task with --trace)
error: in phase 'check': uncaught exception

So it seems there's not much missing!

Thank you!

jeremy commented 8 months ago

Thanks @Apteryks.

Updated to only run that test on Rack 2 where Rack::Lint::InputWrapper is rewindable: https://github.com/rails/marcel/commit/ccd4be5043628c4389230b4c012a7115b8e44c81

In Rack 3, Rack::Lint::Wrapper::InputWrapper is not rewindable.