Sha256: 31c0e8b2a2bc9665f9f2f72aeb68dfaa0f4e3ab1b4440459f87dd385c49c7c8a

Contents?: true

Size: 941 Bytes

Versions: 9

Compression:

Stored size: 941 Bytes

Contents

require 'helper'

class TestPhoneNumberSG < Test::Unit::TestCase
  def setup
    @tester = Faker::PhoneNumberSG
  end

  def test_voip_number
    assert_match /3\d{3}\s\d{4}/, @tester.voip_number
  end

  def test_fixed_line_number
    assert_match /6\d{3}\s\d{4}/, @tester.fixed_line_number
  end

  def test_mobile_number
    assert_match /8\d{3}\s\d{4}/, @tester.mobile_number
  end

  def test_mobile_or_pager_number
    assert_match /9\d{3}\s\d{4}/, @tester.mobile_or_pager_number
  end

  def test_international_toll_free_number
    assert_match /800\s\d{3}\s\d{4}/, @tester.international_toll_free_number
  end

  def test_toll_free_number
    assert_match /1800\s\d{3}\s\d{4}/, @tester.toll_free_number
  end

  def test_premium_service_number
    assert_match /1900\s\d{3}\s\d{4}/, @tester.premium_service_number
  end

  def test_phone_number
	10.times do
		assert_match /[6,8,9]\d{3}\s\d{4}/, @tester.phone_number
	end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ffaker-1.21.0 test/test_phone_number_sg.rb
ffaker-1.20.0 test/test_phone_number_sg.rb
ffaker-1.19.0 test/test_phone_number_sg.rb
ffaker-1.18.0 test/test_phone_number_sg.rb
ffaker-1.17.0 test/test_phone_number_sg.rb
ffaker-1.16.2 test/test_phone_number_sg.rb
ffaker-1.16.1 test/test_phone_number_sg.rb
ffaker-1.16.0 test/test_phone_number_sg.rb
ffaker-1.15.0 test/test_phone_number_sg.rb