From 882367e0a63e54d9f5694db038603bc116f1b721 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 23 Jul 2010 18:34:08 -0400 Subject: [PATCH] Remove t_parameter tests for the Youtube class. --- test/youtube_test.rb | 49 -------------------------------------------- 1 file changed, 49 deletions(-) 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) -- 2.44.2