Commit 72345d6c4e501b0d3ba473a1879c34a7fca15789

Formatted the tests differently to attempt to make them easier to read.
  
2929 end
3030
3131 should "correctly parse urls with pages with ? in the url" do
32 assert_equal "<a href=\"https://www.google.com/?whatever.com\">https://www.google.com/?whatever.com</a>", linkify("https://www.google.com/?whatever.com")
32 assert_equal
33 "<a href=\"https://www.google.com/?whatever.com\">https://www.google.com/?whatever.com</a>",
34 linkify("https://www.google.com/?whatever.com")
3335 end
3436
3537 should "correctly parse urls ending with a '.'" do
36 assert_equal "blah blah <a href=\"https://www.google.com/\">https://www.google.com/</a>. Blah", linkify("blah blah https://www.google.com/. Blah")
38 assert_equal
39 "blah blah <a href=\"https://www.google.com/\">https://www.google.com/</a>. Blah",
40 linkify("blah blah https://www.google.com/. Blah")
3741 end
3842
3943 should "correctly parse urls ending with a '.' at the end of a string" do
40 assert_equal "blah blah <a href=\"https://www.google.com/\">https://www.google.com/</a>.", linkify("blah blah https://www.google.com/.")
44 assert_equal
45 "blah blah <a href=\"https://www.google.com/\">https://www.google.com/</a>.",
46 linkify("blah blah https://www.google.com/.")
4147 end
4248
4349 should "correctly parse urls containing #." do
44 assert_equal "<a href=\"https://www.google.com/#anchor\">https://www.google.com/#anchor</a>", linkify("https://www.google.com/#anchor")
50 assert_equal
51 "<a href=\"https://www.google.com/#anchor\">https://www.google.com/#anchor</a>",
52 linkify("https://www.google.com/#anchor")
4553 end
4654
4755 should "correctly parse urls containing +." do
48 assert_equal "<a href=\"https://www.google.com/+stuff\">https://www.google.com/+stuff</a>", linkify("https://www.google.com/+stuff")
56 assert_equal
57 "<a href=\"https://www.google.com/+stuff\">https://www.google.com/+stuff</a>",
58 linkify("https://www.google.com/+stuff")
4959 end
5060
5161 should "correctly parse urls containing -" do
52 assert_equal "<a href=\"http://www.hypebot.com/hypebot/2009/06/walmart-shutting-down-drm-download-servers.html\">http://www.hypebot.com/hypebot/2009/06/walmart-shutting-down-drm-download-servers.html</a>", linkify("http://www.hypebot.com/hypebot/2009/06/walmart-shutting-down-drm-download-servers.html")
62 assert_equal
63 "<a href=\"http://www.hypebot.com/hypebot/2009/06/walmart-shutting-down-drm-download-servers.html\">http://www.hypebot.com/hypebot/2009/06/walmart-shutting-down-drm-download-servers.html</a>",
64 linkify("http://www.hypebot.com/hypebot/2009/06/walmart-shutting-down-drm-download-servers.html")
5365 end
5466
5567 should "correctly parse urls ending with ':'" do
56 assert_equal "some stuff <a href=\"http://google.com/whatever\">http://google.com/whatever</a>: stuff", linkify("some stuff http://google.com/whatever: stuff")
68 assert_equal
69 "some stuff <a href=\"http://google.com/whatever\">http://google.com/whatever</a>: stuff",
70 linkify("some stuff http://google.com/whatever: stuff")
5771 end
5872
5973 should "correctly parse urls ending with ':' at the end of the string" do
60 assert_equal "some stuff <a href=\"http://google.com/whatever\">http://google.com/whatever</a>:", linkify("some stuff http://google.com/whatever:")
74 assert_equal
75 "some stuff <a href=\"http://google.com/whatever\">http://google.com/whatever</a>:",
76 linkify("some stuff http://google.com/whatever:")
6177 end
62
6378 end
6479end