#
require 'test/unit'
-require 'src/websites/howcast'
+require 'whatever-dl/websites/howcast'
# Unit tests for the Howcast class.
# This class is easy because get_video_url is
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'))
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