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 else condition to prevent false positive #2012

Merged
merged 1 commit into from
May 24, 2020

Conversation

jbergenson
Copy link
Contributor

@jbergenson jbergenson commented May 22, 2020

#2005

Description:

As described in Issue #2005, the Faker::Char.fix_umlauts method has a false positive when the string includes 'ss'. This PR adds an else clause so that the original match (downcased, like the other return values) is returned instead. This PR also adds an additional assertion to the test file to confirm that this false positive is accounted for.

While working on this PR, I observed that this method may be limited in some ways surrounding casing. For example, you might want to replace Ä with Ae or AE, but I thought that would very much complicate the method require several additional test cases and so I left it out for maybe another issue to be added.

@Zeragamba Zeragamba self-assigned this May 23, 2020
@Zeragamba
Copy link
Contributor

Looks good to me, but would like another to look. Not sure if there's another edge case here that someone else may know about.

Copy link
Member

@koic koic left a comment

Choose a reason for hiding this comment

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

I'm unfamiliar with that multibyte character, but the only issue in ae, oe, ue, and ss is ss. It looks like the test case and the fix for the feedback issue case are fine.

@koic koic merged commit 2c3664e into faker-ruby:master May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants