Sha256: c28ee0c3be1b558a7e7bb5d1d07e9536192b282b62a66ecab3d8ecb66c4f3a24

Contents?: true

Size: 1.19 KB

Versions: 10

Compression:

Stored size: 1.19 KB

Contents

# encoding: utf-8

require 'helper'

# Author: wiseleyb<wiseleyb@gmail.com>
class TestPhoneNumberDA < Test::Unit::TestCase
  include DeterministicHelper

  assert_methods_are_deterministic(
    FFaker::PhoneNumberDA,
    :home_work_phone_number, :mobile_phone_number, :phone_number, :country_code,
    :international_mobile_phone_number,
    :international_home_work_phone_number,
    :international_phone_number
  )

  def setup
    @tester = FFaker::PhoneNumberDA
  end

  def test_home_work_phone_number
    assert_match(/\A\d{8}\z/, @tester.home_work_phone_number)
  end

  def test_mobile_phone_number
    assert_match(/\A\d{8}\z/, @tester.mobile_phone_number)
  end

  def test_phone_number
    assert_match(/\A\d{8}\z/, @tester.phone_number)
  end

  def test_country_code
    assert_equal '+45', @tester.country_code
  end

  def test_international_mobile_phone_number
    assert_match(/\A\+45 \d{8}\z/, @tester.international_mobile_phone_number)
  end

  def test_international_home_work_phone_number
    assert_match(/\A\+45 \d{8}\z/, @tester.international_home_work_phone_number)
  end

  def test_international_phone_number
    assert_match(/\A\+45 \d{8}\z/, @tester.international_phone_number)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ffaker-2.11.0 test/test_phone_number_da.rb
ffaker-2.10.0 test/test_phone_number_da.rb
ffaker-2.9.0 test/test_phone_number_da.rb
ffaker-2.8.1 test/test_phone_number_da.rb
ffaker-2.8.0 test/test_phone_number_da.rb
ffaker-2.7.0 test/test_phone_number_da.rb
ffaker-2.6.0 test/test_phone_number_da.rb
ffaker-2.5.0 test/test_phone_number_da.rb
ffaker-2.4.0 test/test_phone_number_da.rb
ffaker-2.3.0 test/test_phone_number_da.rb