Sha256: c3772bc86df27ffff14adf030fc62db2804156cd67c978310612e1851ac3c7cf

Contents?: true

Size: 854 Bytes

Versions: 3

Compression:

Stored size: 854 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

3 entries across 3 versions & 1 rubygems

Version Path
phone_number_validator-0.9.3 test/test_phone_number_validator.rb
phone_number_validator-0.8.8 test/test_phone_number_validator.rb
phone_number_validator-0.8.7 test/test_phone_number_validator.rb