assert_equal%(Go to #{link2_result}.),auto_link(%(Go to #{link2_raw}.))
assert_equal%(<p>Say hello to #{email_result}, then go to #{link2_result}.</p>),auto_link(%(<p>Say hello to #{email_raw}, then go to #{link2_raw}.</p>))
assert_equal%(My pic: <a href="#{pic}"><img src="#{pic}" width="160px"></a> -- full album here #{generate_result(url)}),auto_link("My pic: #{pic} -- full album here #{url}"){|link|
iflink=~/\.(jpg|gif|png|bmp|tif)$/i
raw%(<img src="#{link}" width="160px">)
else
link
end
}
end
deftest_auto_link_with_options_hash
assert_dom_equal'Welcome to my new blog at <a href="http://www.myblog.com/" class="menu" target="_blank">http://www.myblog.com/</a>. Please e-mail me at <a href="mailto:me@email.com" class="menu" target="_blank">me@email.com</a>.',
auto_link("Welcome to my new blog at http://www.myblog.com/. Please e-mail me at me@email.com.",