Sha256: 0f27701f1ef77d7f862cd8bf43cf36e07e811e6f38b91d093f130b32557ba12a

Contents?: true

Size: 1.56 KB

Versions: 14

Compression:

Stored size: 1.56 KB

Contents

# encoding: utf-8

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

14 entries across 14 versions & 3 rubygems

Version Path
solidus_backend-1.0.0.pre3 vendor/bundle/gems/ffaker-1.32.1/test/test_name_ga.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/ffaker-1.32.1/test/test_name_ga.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/ffaker-1.32.1/test/test_name_ga.rb
ffaker-1.32.1 test/test_name_ga.rb
ffaker-1.32.0 test/test_name_ga.rb
ffaker-1.31.0 test/test_name_ga.rb
ffaker-1.30.0 test/test_name_ga.rb
ffaker-1.25.0 test/test_name_ga.rb
ffaker-1.24.0 test/test_name_ga.rb
ffakerer-1.0.2 test/test_faker_name_ga.rb
ffaker-1.23.0 test/test_name_ga.rb
ffakerer-1.0.1 test/test_faker_name_ga.rb
ffaker-1.22.1 test/test_faker_name_ga.rb
ffaker-1.22.0 test/test_faker_name_ga.rb