Skip to content

Commit

Permalink
Merge pull request #1170 from vbrazo/fixes/wrong-parse-ru-methods
Browse files Browse the repository at this point in the history
First_name and last_name should use the parse method - :ru locale
  • Loading branch information
vbrazo authored May 12, 2018
2 parents 5b5d342 + 4b28a6e commit d4a8df3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/faker/name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ def name_with_middle
end

def first_name
fetch('name.first_name')
parse('name.first_name')
end

def last_name
fetch('name.last_name')
parse('name.last_name')
end

def prefix
Expand Down
8 changes: 8 additions & 0 deletions test/test_faker_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ def test_name_with_middle
assert @tester.name_with_middle.match(/(\w+\.? ?){3,4}/)
end

def test_first_name
assert @tester.first_name.match(/(\w+\.? ?){3,4}/)
end

def test_last_name
assert @tester.last_name.match(/(\w+\.? ?){3,4}/)
end

def test_prefix
assert @tester.prefix.match(/[A-Z][a-z]+\.?/)
end
Expand Down

0 comments on commit d4a8df3

Please sign in to comment.