Sha256: 01532e7824852c2fee87129828be692b7c610bebae4356fc7a6d31e2312a5206

Contents?: true

Size: 747 Bytes

Versions: 7

Compression:

Stored size: 747 Bytes

Contents

# frozen_string_literal: true

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

7 entries across 7 versions & 1 rubygems

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