class PhoneNumberValidatorTest
This class respresents the testing-unit for this gem app
Inherits from:
Test::Unit::TestCase
Public Instance Methods
test_invalid_phone_number()
click to toggle source
This test inputs an invalid phone number and expects the output to be false
# File test/test_phone_number_validator.rb, line 20 def test_invalid_phone_number assert_equal false, PhoneNumberValidator.validate_phone_number('94643823637337') end
test_no_phone_number()
click to toggle source
This test inputs no phone number and expectst the output to be :nil
# File test/test_phone_number_validator.rb, line 27 def test_no_phone_number assert_equal :nil, PhoneNumberValidator.validate_phone_number('') end
test_valid_phone_number()
click to toggle source
This test inputs a valid phone number and expects the output to be true
# File test/test_phone_number_validator.rb, line 13 def test_valid_phone_number assert_equal true, PhoneNumberValidator.validate_phone_number('+1 (949) 355-6244 ext. 198842') end