Sha256: 71ba89e7b7c2e274c3b4f9be316e25233b2c47045adea572d11f462ef0cb62ef

Contents?: true

Size: 823 Bytes

Versions: 4

Compression:

Stored size: 823 Bytes

Contents

require 'test/unit'
require 'phone_number_validator'

##
# This class represents the testing-unit for this gem app
#
# <b>Inherits from:</b>
#   Test::Unit::TestCase
class PhoneNumberValidatorTest < Test::Unit::TestCase

  ##
  # This test inputs a valid phone number and expects the output to be <b>true</b>
  def test_valid_phone_number
    assert_equal true,
    PhoneNumberValidator.validate('+1 (987) 654-3210 ext. 198842')
  end

  ##
  # This test inputs an invalid phone number and expects the output to be <b>false</b>
  def test_invalid_phone_number
    assert_equal false,
    PhoneNumberValidator.validate('94643823637337')
  end

  ##
  # This test inputs no phone number and expects the output to be <b>nil</b>
  def test_no_phone_number
    assert_equal :nil,
    PhoneNumberValidator.validate('')
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
phone_number_validator-0.9.2 test/test_phone_number_validator.rb
phone_number_validator-0.9.1 test/test_phone_number_validator.rb
phone_number_validator-0.9.0 test/test_phone_number_validator.rb
phone_number_validator-0.8.9 test/test_phone_number_validator.rb