]> gitweb.michael.orlitzky.com - dead/whatever-dl.git/blob - test/bliptv_test.rb
Whitespace cleanup.
[dead/whatever-dl.git] / test / bliptv_test.rb
1 #
2 # Copyright Michael Orlitzky
3 #
4 # http://michael.orlitzky.com/
5 #
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.
10 #
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.
15 #
16 # http://www.fsf.org/licensing/licenses/gpl.html
17 #
18
19 require 'test/unit'
20 require 'whatever-dl/websites/bliptv'
21
22 class BliptvTest < Test::Unit::TestCase
23
24 def test_owns_bliptv_urls
25 urls = [ 'http://blip.tv/7minutesinheaven/tina-fey-6189804',
26 'blip.tv/7minutesinheaven/tina-fey-6189804' ]
27 urls.each do |url|
28 assert(Bliptv.owns_url?(url), "Owns #{url}")
29 end
30 end
31
32
33 def test_doesnt_own_redtube_urls
34 assert(!Bliptv.owns_url?('http://www.redtube.com/6807'))
35 assert(!Bliptv.owns_url?('www.redtube.com/6807'))
36 assert(!Bliptv.owns_url?('http://redtube.com/6807'))
37 assert(!Bliptv.owns_url?('redtube.com/6807'))
38 end
39
40
41 def test_doesnt_own_howcast_urls
42 assert(!Bliptv.owns_url?('http://www.howcast.com/videos/6807-2twr'))
43 assert(!Bliptv.owns_url?('www.howcast.com/videos/6807-2dgfdg'))
44 assert(!Bliptv.owns_url?('http://howcast.com/videos/6807-cse'))
45 assert(!Bliptv.owns_url?('howcast.com/videos/6807-asdgasd'))
46 end
47
48
49 def test_doesnt_own_misc_urls
50 assert(!Bliptv.owns_url?('http://www.bliptv.com/123456'))
51 end
52
53 end