Sha256: 2951a5fcd9e865ee2b97833bc453c4fc4cf3c948f2bb136c33ae78e14becd5df

Contents?: true

Size: 948 Bytes

Versions: 14

Compression:

Stored size: 948 Bytes

Contents

# encoding: utf-8

require 'helper'

# Author: xarala<pathe.sene@xarala.sn> http://www.xarala.sn
class TestPhoneNumberSN < Test::Unit::TestCase
  def setup
    @tester = Faker::PhoneNumberSN
  end

  def test_mobile_phone_prefix
    assert Faker::PhoneNumberSN::MobileOperatorsPrefix.include?(@tester.mobile_phone_prefix)
  end

  def test_homework_phone_prefix
    assert Faker::PhoneNumberSN::HomeWorkOperatorsPrefix.include?(@tester.homework_phone_prefix)
  end

  def test_short_phone_number
    assert_match /\d{3}-\d{2}-\d{2}/, Faker::PhoneNumberSN.short_phone_number
  end

  def test_mobile_phone_number
    assert_match /(70|76|77)-\d{3}-\d{2}-\d{2}/, Faker::PhoneNumberSN.mobile_number
  end

  def test_phone_number
    assert_match /(33|70|76|77)-\d{3}-\d{2}-\d{2}/, Faker::PhoneNumberSN.phone_number
  end

  def test_homework_phone_number
    assert_match /(33)-(8|9)\d{2}-\d{2}-\d{2}/, Faker::PhoneNumberSN.homework_number
  end
end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
solidus_backend-1.0.0.pre3 vendor/bundle/gems/ffaker-1.32.1/test/test_phone_number_sn.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/ffaker-1.32.1/test/test_phone_number_sn.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/ffaker-1.32.1/test/test_phone_number_sn.rb
ffaker-1.32.1 test/test_phone_number_sn.rb
ffaker-1.32.0 test/test_phone_number_sn.rb
ffaker-1.31.0 test/test_phone_number_sn.rb
ffaker-1.30.0 test/test_phone_number_sn.rb
ffaker-1.25.0 test/test_phone_number_sn.rb
ffaker-1.24.0 test/test_phone_number_sn.rb
ffakerer-1.0.2 test/test_phone_number_sn.rb
ffaker-1.23.0 test/test_phone_number_sn.rb
ffakerer-1.0.1 test/test_phone_number_sn.rb
ffaker-1.22.1 test/test_phone_number_sn.rb
ffaker-1.22.0 test/test_phone_number_sn.rb