]> gitweb.michael.orlitzky.com - dead/whatever-dl.git/blobdiff - test/redtube_test.rb
Made the output filename the responsibility of the website subclass.
[dead/whatever-dl.git] / test / redtube_test.rb
index b6cae0f5f3fa6153b3b9361b01a4f0e8d9d4e2cd..9d6c709120fc0a3f46b5a948741629dffa2d1ee7 100644 (file)
@@ -47,10 +47,18 @@ class RedtubeTest < Test::Unit::TestCase
 
   
   def test_get_video_url
-    rt = Redtube.new()
-
-    test_result = rt.get_video_url('http://www.redtube.com/6807')
-    assert_equal("http://dl.redtube.com/_videos_t4vn23s9jc5498tgj49icfj4678/0000006/X57OBH08G.flv", test_result)
+    rt = Redtube.new('http://www.redtube.com/6807')
+    expected_result = 'http://dl.redtube.com/_videos_t4vn23s9jc5498tgj49icfj4678/0000006/X57OBH08G.flv'
+    actual_result = rt.get_video_url()
+    assert_equal(expected_result, actual_result)
   end
 
+  
+  def test_get_video_filename
+    rt = Redtube.new('http://www.redtube.com/6807')
+    # I don't know where they get these filenames from, but whatever.
+    expected_result = 'X57OBH08G.flv'
+    actual_result = rt.get_video_filename()
+    assert_equal(expected_result, actual_result)
+  end
 end