Sha256: 9b5529d2bbb04b17ac46247694fb1e6b83e9c69158081403acee98410fe187e2
Contents?: true
Size: 1.49 KB
Versions: 8
Compression:
Stored size: 1.49 KB
Contents
require 'helper' class TestFakerNameGa < Test::Unit::TestCase def setup @tester = Faker::NameGA end def test_last_name assert Faker::NameGA::LAST_NAMES.include?(@tester.last_name) end def test_first_name_male assert Faker::NameGA::FIRST_NAMES_MALE.include?(@tester.first_name_male) end def test_first_name_female assert Faker::NameGA::FIRST_NAMES_FEMALE.include?(@tester.first_name_female) end def test_name_male # => split the name_male into an array of words parts = @tester.name_male.split(' ') # the value at the index 0 should be a valid! male_prefix assert Faker::NameGA::FIRST_NAMES_MALE.include?(parts[0]) # the value at the index 1 should be a valid! last_name assert Faker::NameGA::LAST_NAMES.include?(parts[1]) end def test_name_female # => split the name_male into an array of words parts = @tester.name_female.split(' ') # the value at the index 0 should be a valid! male_prefix assert Faker::NameGA::FIRST_NAMES_FEMALE.include?(parts[0]) # the value at the index 1 should be a valid! last_name assert Faker::NameGA::LAST_NAMES.include?(parts[1]) end def test_name # => split the name_male into an array of words parts = @tester.name.split(' ') # the value at the index 0 should be a valid! male_prefix assert Faker::NameGA::FIRST_NAMES_FEMALE.include?(parts[0]) || Faker::NameGA::FIRST_NAMES_MALE.include?(parts[0]) # the value at the index 1 should be a valid! last_name assert Faker::NameGA::LAST_NAMES.include?(parts[1]) end end
Version data entries
8 entries across 8 versions & 1 rubygems