]> gitweb.michael.orlitzky.com - dead/whatever-dl.git/blob - test/veoh_test.rb
f104d3a807f6b24325acba7fbcc2ee081db96f34
[dead/whatever-dl.git] / test / veoh_test.rb
1 require 'test/unit'
2 require 'src/websites/veoh'
3
4 class VeohTest < Test::Unit::TestCase
5
6 def test_parse_video_id
7 v = Veoh.new
8 video_id = v.send('parse_video_id', 'http://www.veoh.com/videos/v801204yMZ8BWcC')
9 assert_equal('v801204yMZ8BWcC', video_id)
10 end
11
12
13 def test_parse_redirect_url
14 v = Veoh.new
15
16 details_data = nil
17
18 File.open('test/fixtures/veoh/details_data-v801204yMZ8BWcC.xml') do |f|
19 details_data = f.read
20 end
21
22 actual_result = v.send('parse_redirect_url', details_data)
23 expected_result = 'http://content.veoh.com/flash/p/801204/7b55b0e3fef09c5599ba2ab3d6a270c3dc9c0a0d.flv?ct=8c18f78c97a2df5cb5f7d849dce97c28996b0835dfc71ce9'
24
25 assert_equal(expected_result, actual_result)
26 end
27
28
29 def test_owns_veoh_urls
30 assert(Veoh.owns_url?('http://www.veoh.com/videos/v801204yMZ8BWcC'))
31 end
32
33 end