Sha256: 573d67dc8511c3505824117ebe6f5d887417a8063969603cb648be81e27f34ce

Contents?: true

Size: 681 Bytes

Versions: 6

Compression:

Stored size: 681 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')

class TestEnUgLocale < Test::Unit::TestCase
  def setup
    @previous_locale = Faker::Config.locale
    Faker::Config.locale = 'en-UG'
  end

  def teardown
    Faker::Config.locale = @previous_locale
  end

  def test_validity_of_phone_number
    validation_regex = /^((0)|(256)|(\+256))((39)|(41))\d{7}$/
    assert_match(validation_regex, Faker::PhoneNumber.phone_number.gsub(' ',''))
  end

  def test_validity_of_cell_phone
    validation_regex = /^((0)|(256)|(\+256))((70)|(71)|(72)|(74)|(75)|(77)|(78)|(79))\d{7}$/
    assert_match(validation_regex, Faker::PhoneNumber.cell_phone.gsub(' ',''))
  end

end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
faker-1.6.3 test/test_en_ug_locale.rb
faker-1.6.2 test/test_en_ug_locale.rb
faker-1.6.1 test/test_en_ug_locale.rb
faker-1.6.0 test/test_en_ug_locale.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/faker-1.5.0/test/test_en_ug_locale.rb
faker-1.5.0 test/test_en_ug_locale.rb