Sha256: ec148bc6e0ccaea1178ed7047ce594412ca5ec79bd8c460dd8b1aac39bd3d6e0

Contents?: true

Size: 986 Bytes

Versions: 5

Compression:

Stored size: 986 Bytes

Contents

# frozen_string_literal: true

require_relative '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

5 entries across 5 versions & 1 rubygems

Version Path
ffaker-2.23.0 test/test_name_ar.rb
ffaker-2.22.0 test/test_name_ar.rb
ffaker-2.21.0 test/test_name_ar.rb
ffaker-2.20.0 test/test_name_ar.rb
ffaker-2.19.0 test/test_name_ar.rb