Sha256: 52933cf721f1811784bd23e723650d95e365f95eeb62850a6f3c402ac848380a

Contents?: true

Size: 921 Bytes

Versions: 5

Compression:

Stored size: 921 Bytes

Contents

# frozen_string_literal: true

require_relative 'helper'

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

  assert_methods_are_deterministic(
    FFaker::NameNB,
    :last_name, :first_name_male, :first_name_female, :prefix, :first_name,
    :name
  )

  def setup
    @tester = FFaker::NameNB
  end

  def test_last_name
    assert_include @tester::LAST_NAMES, @tester.last_name
  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_prefix
    assert_include @tester::PREFIXES, @tester.prefix
  end

  def test_first_name
    parts = @tester.first_name.split(' ')
    assert_include [1, 2], parts.count
  end

  def test_name
    parts = @tester.name.split(' ')
    assert_include [2, 3, 4], parts.count
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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