1 # Unit tests for the Howcast class.
2 # This class is easy because get_video_url is
3 # just a string interpolation (we don't have to
7 require 'src/websites/howcast'
9 class HowcastTest
< Test
::Unit::TestCase
11 def test_owns_howcast_urls
13 assert(Howcast
.owns_url
?('http://www.howcast.com/videos/6807-2twr'))
14 assert(Howcast
.owns_url
?('www.howcast.com/videos/6807-2dgfdg'))
15 assert(Howcast
.owns_url
?('http://howcast.com/videos/6807-cse'))
16 assert(Howcast
.owns_url
?('howcast.com/videos/6807-asdgasd'))
20 def test_doesnt_own_redtube_urls
21 assert(!Howcast
.owns_url
?('http://www.redtube.com/6807'))
22 assert(!Howcast
.owns_url
?('www.redtube.com/6807'))
23 assert(!Howcast
.owns_url
?('http://redtube.com/6807'))
24 assert(!Howcast
.owns_url
?('redtube.com/6807'))
27 def test_doesnt_own_misc_urls
28 assert(!Howcast
.owns_url
?('http://www.howcast.com/abc'))