Sha256: 245db87b4b9ea9f4ab6347e71f304ae5e0aa5fe141d43c589aec572935b37107
Contents?: true
Size: 1.21 KB
Versions: 14
Compression:
Stored size: 1.21 KB
Contents
# encoding: utf-8 require 'helper' # Author: PapePathe<pathe.sene@gmail.com> github.com/PapePathe class TestFakerNameFR < Test::Unit::TestCase def setup @tester = Faker::NameFR end def test_last_name assert Faker::NameFR::LAST_NAMES.include?(@tester.last_name) end def test_first_name assert Faker::NameFR::FIRST_NAMES.include?(@tester.first_name) end def test_prefix assert Faker::NameFR::PREFIX.include?(@tester.prefix) end def test_name # => split the name into an array of words parts = @tester.name.split(' ') if parts.count == 3 # the value at the index 1 should be a valid! prefix assert Faker::NameFR::PREFIX.include?(parts[1]) # the value at the index 0 should be a valid! male_first_name assert Faker::NameFR::FIRST_NAMES.include?(parts[0]) # the value at the index 2 should be a valid! last_name assert Faker::NameFR::LAST_NAMES.include?(parts[2]) elsif parts.count == 2 # the value at the index 0 should be a valid! prefix assert Faker::NameFR::FIRST_NAMES.include?(parts[0]) # the value at the index 1 should be a valid! last_name assert Faker::NameFR::LAST_NAMES.include?(parts[1]) end end end
Version data entries
14 entries across 14 versions & 3 rubygems