test/countries/hr_test.rb in phone-0.9.9.3 vs test/countries/hr_test.rb in phone-1.0
- old
+ new
@@ -26,51 +26,51 @@
def test_zagreb_long_with_leading_zeros
parse_test('0038513668734', '385', '1', '3668734')
end
def test_short_without_special_characters_with_country
- Phone.default_country_code = '385'
+ Phoner::Phone.default_country_code = '385'
parse_test('044885047', '385', '44', '885047')
end
def test_zagreb_short_without_special_characters_with_country
- Phone.default_country_code = '385'
+ Phoner::Phone.default_country_code = '385'
parse_test('013668734', '385', '1', '3668734')
end
def test_long_with_zero_in_brackets
- Phone.default_country_code = nil
+ Phoner::Phone.default_country_code = nil
parse_test('+385 (0)1 366 8111', '385', '1', '3668111')
end
def test_has_default_country_code
- Phone.default_country_code = '385'
+ Phoner::Phone.default_country_code = '385'
- assert_equal Phone.parse('+38547451588').has_default_country_code?, true
- assert_equal Phone.parse('+38647451588').has_default_country_code?, false
+ assert_equal Phoner::Phone.parse('+38547451588').has_default_country_code?, true
+ assert_equal Phoner::Phone.parse('+38647451588').has_default_country_code?, false
end
def test_has_default_area_code
- Phone.default_country_code = '385'
- Phone.default_area_code = '47'
+ Phoner::Phone.default_country_code = '385'
+ Phoner::Phone.default_area_code = '47'
- assert_equal Phone.parse('047/451-588').has_default_area_code?, true
- assert_equal Phone.parse('032/336-1456').has_default_area_code?, false
+ assert_equal Phoner::Phone.parse('047/451-588').has_default_area_code?, true
+ assert_equal Phoner::Phone.parse('032/336-1456').has_default_area_code?, false
end
def test_validates
- Phone.default_country_code = nil
- assert_equal Phone.valid?('00385915125486'), true
- assert_equal Phone.valid?('+385915125486'), true
- assert_equal Phone.valid?('+385 (91) 512 5486'), true
- assert_equal Phone.valid?('+38547451588'), true
+ Phoner::Phone.default_country_code = nil
+ assert_equal Phoner::Phone.valid?('00385915125486'), true
+ assert_equal Phoner::Phone.valid?('+385915125486'), true
+ assert_equal Phoner::Phone.valid?('+385 (91) 512 5486'), true
+ assert_equal Phoner::Phone.valid?('+38547451588'), true
- Phone.default_country_code = '385'
- assert_equal Phone.valid?('0915125486'), true
- assert_equal Phone.valid?('091/512-5486'), true
- assert_equal Phone.valid?('091/512-5486'), true
- assert_equal Phone.valid?('091 512 54 86'), true
- assert_equal Phone.valid?('091-512-54-86'), true
- assert_equal Phone.valid?('047/451-588'), true
+ Phoner::Phone.default_country_code = '385'
+ assert_equal Phoner::Phone.valid?('0915125486'), true
+ assert_equal Phoner::Phone.valid?('091/512-5486'), true
+ assert_equal Phoner::Phone.valid?('091/512-5486'), true
+ assert_equal Phoner::Phone.valid?('091 512 54 86'), true
+ assert_equal Phoner::Phone.valid?('091-512-54-86'), true
+ assert_equal Phoner::Phone.valid?('047/451-588'), true
end
end