X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fwhatever-dl.git;a=blobdiff_plain;f=test%2Fveoh_test.rb;h=ad37267fef03f595275e0844f212554027d40be1;hp=1a53e431b1481d555e7151041189c17f03935613;hb=83e06f83d8274cb32a406739839d56e759664b09;hpb=2c835ed7a247ed5639277bc9674b848722ad998d diff --git a/test/veoh_test.rb b/test/veoh_test.rb index 1a53e43..ad37267 100644 --- a/test/veoh_test.rb +++ b/test/veoh_test.rb @@ -22,14 +22,21 @@ require 'src/websites/veoh' class VeohTest < Test::Unit::TestCase def test_parse_video_id - v = Veoh.new - video_id = v.send('parse_video_id', 'http://www.veoh.com/videos/v801204yMZ8BWcC') + v = Veoh.new('http://www.veoh.com/videos/v801204yMZ8BWcC') + video_id = v.send('parse_video_id') assert_equal('v801204yMZ8BWcC', video_id) end + + def test_parse_second_video_id + v = Veoh.new('http://www.veoh.com/videos/v15795090Z6mZAbSq') + video_id = v.send('parse_video_id') + assert_equal('v15795090Z6mZAbSq', video_id) + end + def test_parse_redirect_url - v = Veoh.new + v = Veoh.new(nil) details_data = nil @@ -42,10 +49,28 @@ class VeohTest < Test::Unit::TestCase assert_equal(expected_result, actual_result) end + + + def test_second_parse_redirect_url + v = Veoh.new(nil) + + details_data = nil + + File.open('test/fixtures/veoh/details_data-v15795090Z6mZAbSq.xml') do |f| + details_data = f.read + end + + actual_result = v.send('parse_redirect_url', details_data) + expected_result = 'http://content.veoh.com/flash/f/2/v15795090Z6mZAbSq/3f8044ce2538155c55af5c036cd96ba82a83ddb5.flv?ct=ff4914d2e699e8ad04a69102faaab6ce82b7704998890f69' + + assert_equal(expected_result, actual_result) + end + def test_owns_veoh_urls assert(Veoh.owns_url?('http://www.veoh.com/videos/v801204yMZ8BWcC')) + assert(Veoh.owns_url?('http://www.veoh.com/videos/v15795090Z6mZAbSq')) end end