Sha256: ca94b1e096523ced0a0faf5ed352e0ca2b02fb2af17ebc8934cfe34d1bbc1633

Contents?: true

Size: 826 Bytes

Versions: 4

Compression:

Stored size: 826 Bytes

Contents

require 'test/unit'
require 'phone_number_validator'

##
# This class respresents 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 (949) 355-6244 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 expectst 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.7.8 test/test_phone_number_validator.rb
phone_number_validator-0.7.7 test/test_phone_number_validator.rb
phone_number_validator-0.7.6 test/test_phone_number_validator.rb
phone_number_validator-0.7.5 test/test_phone_number_validator.rb