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/fuckedtube'
23 class FuckedtubeTest
< Test
::Unit::TestCase
25 def test_owns_fuckedtube_urls
26 assert(Fuckedtube
.owns_url
?('http://www.fuckedtube.com/video/161/Pumped-Pussy/'))
27 assert(Fuckedtube
.owns_url
?('http://www.fuckedtube.com/video/152/Hits-From-The-Pong'))
28 assert(Fuckedtube
.owns_url
?('http://www.fuckedtube.com/video/143/Hot-n-Spicy-Jizz/'))
29 assert(Fuckedtube
.owns_url
?('http://www.fuckedtube.com/video/4/I-Spy-A-Cervix'))
33 def test_doesnt_own_infoq_urls
34 assert(!Fuckedtube
.owns_url
?('http://www.infoq.com/interviews/jim-weirich-discusses-rake'))
38 def test_doesnt_own_efukt_urls
39 assert(!Fuckedtube
.owns_url
?('http://www.efukt.com/2308_How_To_Fuck_Like_A_King.html'))
40 assert(!Fuckedtube
.owns_url
?('http://www.efukt.com/2304_The_Dumbest_Porno_Ever_Made.html'))
44 def test_parse_video_url
45 ft
= Fuckedtube
.new(nil)
49 File
.open('test/fixtures/fuckedtube/3.html') do |f
|
53 test_result
= ft
.send('parse_video_url', page_data
)
54 assert_equal('http://www.fuckedtube.com/videos/br_scan.flv', test_result
)