X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fwhatever-dl.git;a=blobdiff_plain;f=test%2Fyoutube_test.rb;h=233f31bafadd7e9d71918a94ac70f0547c457589;hp=be356aac9716a5e25e2499e8f8cb7820090cce60;hb=882367e0a63e54d9f5694db038603bc116f1b721;hpb=472100d8bdaa56dac7d405e7a772f75510067626 diff --git a/test/youtube_test.rb b/test/youtube_test.rb index be356aa..233f31b 100644 --- a/test/youtube_test.rb +++ b/test/youtube_test.rb @@ -63,55 +63,6 @@ class YoutubeTest < Test::Unit::TestCase end - def test_parse_t_parameter - yt = Youtube.new(nil) - - page_data = nil - - File.open('test/fixtures/youtube/SudixyugiX4.html') do |f| - page_data = f.read - end - - expected_result = 'OEgsToPDskLQUAntWWpzhEMhBMlgqHdo' - actual_result = yt.send('parse_t_parameter', page_data) - assert_equal(expected_result, actual_result) - end - - - def test_parse_t_parameter_again - # This was failing once because my regex missed a hyphen. - # I modified the regex to match anything between the pair - # of quotes, so it should now catch the hyphen and underscore. - yt = Youtube.new(nil) - - page_data = nil - - File.open('test/fixtures/youtube/K9iDMcmm0tE.html') do |f| - page_data = f.read - end - - expected_result = 'O_EgsToPDskJsXVvAXpAct1zug-lBJBz' - actual_result = yt.send('parse_t_parameter', page_data) - assert_equal(expected_result, actual_result) - end - - - def test_parse_t_parameter_from_url - # Tests a different regex than the other 't' parameter tests. - yt = Youtube.new(nil) - - page_data = nil - - File.open('test/fixtures/youtube/cpU27Xp8zdM.html') do |f| - page_data = f.read - end - - expected_result = 'vjVQa1PpcFNyKz8nP3yZ3MHcwOvLXsOWpCJHkgJVShI=' - actual_result = yt.send('parse_t_parameter', page_data) - assert_equal(expected_result, actual_result) - end - - def test_get_available_formats # Make sure that we can parse the available formats from a page. yt = Youtube.new(nil)