Sha256: d98fd4b6b84aa869df6227cf0cd49e0f03c681addaabe5b2ee6ae1f285ffa38b

Contents?: true

Size: 977 Bytes

Versions: 7

Compression:

Stored size: 977 Bytes

Contents

# frozen_string_literal: true

require 'helper'

class TestFakerNameAR < Test::Unit::TestCase
  include DeterministicHelper

  assert_methods_are_deterministic(
    FFaker::NameAR,
    :first_name_male, :first_name_female, :last_name,
    :name_male, :name_female
  )

  def setup
    @tester = FFaker::NameAR
  end

  def test_first_name_male
    assert_include(@tester::FIRST_NAMES_MALE, @tester.first_name_male)
  end

  def test_first_name_female
    assert_include(@tester::FIRST_NAMES_FEMALE, @tester.first_name_female)
  end

  def test_last_name
    assert_include(@tester::LAST_NAMES, @tester.last_name)
  end

  def test_name_male
    expected = @tester::FIRST_NAMES_MALE.product(@tester::LAST_NAMES).map { |set| set.join(' ') }
    assert_include(expected, @tester.name_male)
  end

  def test_name_female
    expected = @tester::FIRST_NAMES_FEMALE.product(@tester::LAST_NAMES).map { |set| set.join(' ') }
    assert_include(expected, @tester.name_female)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ffaker-2.18.0 test/test_name_ar.rb
ffaker-2.17.0 test/test_name_ar.rb
ffaker-2.16.0 test/test_name_ar.rb
ffaker-2.15.0 test/test_name_ar.rb
ffaker-2.14.0 test/test_name_ar.rb
ffaker-2.13.0 test/test_name_ar.rb
ffaker-2.12.0 test/test_name_ar.rb