2 # Copyright Michael Orlitzky
4 # http://michael.orlitzky.com/
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # http://www.fsf.org/licensing/licenses/gpl.html
20 require 'src/websites/howcast'
22 # Unit tests for the Howcast class.
23 # This class is easy because get_video_url is
24 # just a string interpolation (we don't have to
27 class HowcastTest
< Test
::Unit::TestCase
29 def test_owns_howcast_urls
31 assert(Howcast
.owns_url
?('http://www.howcast.com/videos/6807-2twr'))
32 assert(Howcast
.owns_url
?('www.howcast.com/videos/6807-2dgfdg'))
33 assert(Howcast
.owns_url
?('http://howcast.com/videos/6807-cse'))
34 assert(Howcast
.owns_url
?('howcast.com/videos/6807-asdgasd'))
38 def test_doesnt_own_redtube_urls
39 assert(!Howcast
.owns_url
?('http://www.redtube.com/6807'))
40 assert(!Howcast
.owns_url
?('www.redtube.com/6807'))
41 assert(!Howcast
.owns_url
?('http://redtube.com/6807'))
42 assert(!Howcast
.owns_url
?('redtube.com/6807'))
45 def test_doesnt_own_misc_urls
46 assert(!Howcast
.owns_url
?('http://www.howcast.com/abc'))