Skip to content

Test Mime::Type#=== and nil matching - #57547

Merged
fatkodima merged 1 commit into
rails:mainfrom
hammadxcm:test-mime-type-matchers
Jun 3, 2026
Merged

fatkodima merged 1 commit into
rails:mainfrom
hammadxcm:test-mime-type-matchers

Conversation

@hammadxcm

Copy link
Copy Markdown
Contributor

Mime::Type#=== matches when the type is included in a given array (used for case/when against a list of mime types), and #=~/#match? guard against a nil argument by returning false. Neither the array form of #=== nor the nil guard had a test.

This adds coverage for both. No production code changes — test-only.

Mime::Type#=== matches when the type is included in a given array,
and #=~/#match? guard against a nil argument by returning false.
Neither the array form of #=== nor the nil guard had a test.

Add coverage for both.
@fatkodima
fatkodima merged commit bf7e7b1 into rails:main Jun 3, 2026
2 checks passed
@fatkodima

fatkodima commented Jun 3, 2026 •

Copy link
Copy Markdown
Member

I think maybe open a single PR for missing tests (if they are simple) per Rails component in the future 🤔.

@hammadxcm

Copy link
Copy Markdown
Contributor Author

I think maybe open a single PR for missing tests (if they are simple) per Rails component in the future 🤔.

Sure. I am not familiar with the practices we follow. I will create single PRs now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants