Sha256: 6a1ca6a6eba6aa04b1c5d5f19e17a628095ef9b5ddc1295b928aaec18335aca2

Contents?: true

Size: 515 Bytes

Versions: 1

Compression:

Stored size: 515 Bytes

Contents

# encoding: utf-8

require 'helper'

class TestPhoneNumer < Test::Unit::TestCase
  def test_phone_number
    assert_match /\d{3}[. -]\d{3}/, FFaker::PhoneNumber.phone_number
  end

  def test_short_phone_number
    assert_match /\d{3}-\d{3}-\d{4}/, FFaker::PhoneNumber.short_phone_number
  end

  def test_imei
    assert_match /^\d{15}$/, FFaker::PhoneNumber.imei
  end

  def test_imei_with_sn
    sn = rand(1_000_000)
    assert_match /^\d{8}#{sprintf('%06d', sn)}\d{1}$/, FFaker::PhoneNumber.imei(sn)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ffaker-2.1.0 test/test_phone_number.rb