Sha256: 69a8c93cd45afed05c016e7ded337c18876bf25b6dfae812ac1de1f4f02379d4

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

require_relative 'helper'

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

  assert_methods_are_deterministic(
    FFakerTW::PhoneNumberUA,
    :phone_number, :home_phone_number, :mobile_phone_number,
    :international_home_phone_number, :international_mobile_phone_number
  )

  def setup
    @tester = FFakerTW::PhoneNumberUA
  end

  def test_phone_number
    assert_match(/^(\+(380)\s|0)[0-9]{2}\s[0-9]{3}-[0-9]{4}$/, @tester.phone_number)
  end

  def test_home_phone_number
    assert_match(/^0{1}[0-9]{2}\s[0-9]{3}-[0-9]{4}$/, @tester.home_phone_number)
  end

  def test_mobile_phone_number
    assert_match(/^0{1}[0-9]{2}\s[0-9]{3}-[0-9]{4}$/, @tester.mobile_phone_number)
  end

  def test_international_home_phone_number
    assert_match(/^\+(380)\s[0-9]{2}\s[0-9]{3}-[0-9]{4}$/, @tester.international_home_phone_number)
  end

  def international_mobile_phone_number
    assert_match(/^\+(380)\s[0-9]{2}\s[0-9]{3}-[0-9]{4}$/,
                 @tester.international_mobile_phone_number)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ffakerTW-0.1.0 test/test_phone_number_ua.rb