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

Repeated "Mc" prefix leads to incorrect duplication #9

Open
aprescott opened this issue Dec 11, 2015 · 0 comments
Open

Repeated "Mc" prefix leads to incorrect duplication #9

aprescott opened this issue Dec 11, 2015 · 0 comments

Comments

@aprescott
Copy link

I'm not sure if this is actually a bug, given possible real-world inputs, but it certainly seems wrong.

>> NameCase("mcfoo mcbar")
=> "McFoo McFoo"
>> NameCase("MCFOO MCBAR")
=> "McFoo McFoo"

The "McBar" has been clobbered by "McFoo" because the replacement is global across the whole string. This gem seems to support passing a full first+last name input, so this looks like a bug to me.

Note this working case, though:

>> NameCase("McFoo McBar")
=> "McFoo McBar"
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

No branches or pull requests

1 participant