Skip to content

Commit

Permalink
Merge pull request #2012 from jbergenson/update-fix-umlauts
Browse files Browse the repository at this point in the history
Add else condition to prevent false positive
  • Loading branch information
koic committed May 24, 2020
2 parents 53341f8 + 34bbe72 commit 2c3664e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/helpers/char.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def self.fix_umlauts(string)
when 'ö' then 'oe'
when 'ü' then 'ue'
when 'ß' then 'ss'
else match.downcase
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions test/faker/default/test_faker_char.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ def test_fix_umlauts
assert @tester.fix_umlauts('ö') == 'oe'
assert @tester.fix_umlauts('ü') == 'ue'
assert @tester.fix_umlauts('ß') == 'ss'
# tests false positive
assert @tester.fix_umlauts('ss') == 'ss'
end
end

0 comments on commit 2c3664e

Please sign in to comment.