+
+ def test_telephone_link
+ link = telephone_link("foo", "Test")
+ assert_nil link
+
+ link = telephone_link("phone", "+123")
+ assert_nil link
+
+ link = telephone_link("phone", "123")
+ assert_nil link
+
+ link = telephone_link("phone", "123 abcdefg")
+ assert_nil link
+
+ link = telephone_link("phone", "+1234567890 abc")
+ assert_nil link
+
+ link = telephone_link("phone", "+1234567890; +22334455667788")
+ assert_nil link
+
+ link = telephone_link("phone", "1234567890")
+ assert_nil link
+
+ link = telephone_link("phone", "+1234567890")
+ assert_equal "tel:+1234567890", link
+
+ link = telephone_link("phone", "+1234-567-890")
+ assert_equal "tel:+1234-567-890", link
+
+ link = telephone_link("phone", "+1234/567/890")
+ assert_equal "tel:+1234/567/890", link
+
+ link = telephone_link("phone", "+1234.567.890")
+ assert_equal "tel:+1234.567.890", link
+
+ link = telephone_link("phone", " +1234 567-890 ")
+ assert_equal "tel:+1234567-890", link
+
+ link = telephone_link("phone", "+1 234-567-890")
+ assert_equal "tel:+1234-567-890", link
+
+ link = telephone_link("phone", "+1 (234) 567-890")
+ assert_equal "tel:+1(234)567-890", link
+ end