]> gitweb.michael.orlitzky.com - dead/whatever-dl.git/blob - test/howcast_test.rb
Initial commit.
[dead/whatever-dl.git] / test / howcast_test.rb
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
4 # test that).
5
6 require 'test/unit'
7 require 'src/websites/howcast'
8
9 class HowcastTest < Test::Unit::TestCase
10
11 def test_owns_howcast_urls
12
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'))
17 end
18
19
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'))
25 end
26
27 def test_doesnt_own_misc_urls
28 assert(!Howcast.owns_url?('http://www.howcast.com/abc'))
29 end
30 end