Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to generate a mime type of a specific media type #2518

Conversation

ric2b
Copy link
Contributor

@ric2b ric2b commented Aug 4, 2022

Adds an optional media_type parameter to the File.mime_type method, which will generate mime types for that specific media type only.

This can be useful when testing components that are only supposed to handle image files, for example.

@Zeragamba
Copy link
Contributor

Just one minor change, and this is good to go!

@@ -58,8 +58,8 @@ def extension
# Faker::File.mime_type #=> "application/pdf"
#
# @faker.version 1.6.4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@faker.version should be updated to next since this is adding new features

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, and updated the docs to clarify this :)

@ric2b ric2b requested a review from Zeragamba August 8, 2022 14:31
Copy link
Contributor

@Zeragamba Zeragamba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on the docs. lgtm

@Zeragamba Zeragamba merged commit 15a8bc3 into faker-ruby:master Aug 8, 2022
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.

3 participants