Skip to content

FR locale "name" broken #2783

@ojsdude

Description

@ojsdude

Describe the bug

When using the fr locale; the Faker::Name.name method sometimes errors with:

no implicit conversion of nil into String (TypeError)

I believe this is due to the prefix being nil and sometimes name will choose the prefix version (#{prefix} #{first_name} #{last_name})

To Reproduce

10 times calling .name works pretty consistently
Use the reproduction script below to reproduce the issue:

require "faker"
10.times do
  I18n.with_locale :fr do
    Faker::Name.name
  end
end

Expected behavior

Either prefix is available; or the two options including a prefix (name and middle) are removed from https://github.com/faker-ruby/faker/blob/main/lib/locales/fr/name.yml

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions