Sha256: 3f306fb81ae6816bbb40ff630aea29348cf439e49de02a51962d3baa5e348e0d

Contents?: true

Size: 756 Bytes

Versions: 4

Compression:

Stored size: 756 Bytes

Contents

# frozen_string_literal: true

require_relative 'helper'

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

  assert_methods_are_deterministic(
    FFaker::PhoneNumberNL,
    :mobile_phone_number, :phone_number, :international_phone_number
  )

  def setup
    @tester = FFaker::PhoneNumberNL
  end

  def test_mobile_phone_prefix
    assert @tester.mobile_phone_number.start_with?('06')
  end

  def test_phone_prefix
    assert @tester.phone_number.start_with?('0')
  end

  def test_phone_number
    10.times do
      assert_match(/^0([\s\-]*\d){9}$/, @tester.phone_number)
    end
  end

  def test_international_phone_number
    10.times do
      assert_match(/^\+31/, @tester.international_phone_number)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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