X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=test%2Fhowcast_test.rb;h=91c1d6a336c7dcaab4ceb3f185b76df169321351;hb=63a898d70c90cf95f423fcd396af9b4639f1c3dd;hp=a76c725689f01259f3219ca1cc9a0ce48e787b25;hpb=00f5e6f475d07afa862c8f33854d8ed52185ea81;p=dead%2Fwhatever-dl.git diff --git a/test/howcast_test.rb b/test/howcast_test.rb index a76c725..91c1d6a 100644 --- a/test/howcast_test.rb +++ b/test/howcast_test.rb @@ -26,8 +26,7 @@ require 'src/websites/howcast' class HowcastTest < Test::Unit::TestCase - def test_owns_howcast_urls - + def test_owns_howcast_urls assert(Howcast.owns_url?('http://www.howcast.com/videos/6807-2twr')) assert(Howcast.owns_url?('www.howcast.com/videos/6807-2dgfdg')) assert(Howcast.owns_url?('http://howcast.com/videos/6807-cse')) @@ -42,7 +41,23 @@ class HowcastTest < Test::Unit::TestCase assert(!Howcast.owns_url?('redtube.com/6807')) end + def test_doesnt_own_misc_urls assert(!Howcast.owns_url?('http://www.howcast.com/abc')) end + + + def test_parse_file_path_from_xml + hc = Howcast.new(nil) + + page_data = nil + + File.open('test/fixtures/howcast/81134.xml') do |f| + page_data = f.read + end + + test_result = hc.send('parse_file_path_from_xml', page_data) + assert_equal('/system/videos/4/34/11/08/81134.flv', test_result) + end + end