From 9ff1e787f915539b1980654e3d3d2013ff5c81d2 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Mon, 7 Jul 2008 07:38:25 +0000 Subject: wrong commit; sorry git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_8_6_269@17938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby_1_8_6/test/rss/rss-testcase.rb | 293 ------------------------------------ 1 file changed, 293 deletions(-) delete mode 100644 ruby_1_8_6/test/rss/rss-testcase.rb (limited to 'ruby_1_8_6/test/rss/rss-testcase.rb') diff --git a/ruby_1_8_6/test/rss/rss-testcase.rb b/ruby_1_8_6/test/rss/rss-testcase.rb deleted file mode 100644 index dc57b6b0e8..0000000000 --- a/ruby_1_8_6/test/rss/rss-testcase.rb +++ /dev/null @@ -1,293 +0,0 @@ -require "erb" - -require "test/unit" -require 'rss-assertions' - -module RSS - class TestCase < Test::Unit::TestCase - include ERB::Util - - include RSS - include Assertions - - XMLDECL_VERSION = "1.0" - XMLDECL_ENCODING = "UTF-8" - XMLDECL_STANDALONE = "no" - - RDF_ABOUT = "http://www.xml.com/xml/news.rss" - RDF_RESOURCE = "http://xml.com/universal/images/xml_tiny.gif" - TITLE_VALUE = "XML.com" - LINK_VALUE = "http://xml.com/pub" - URL_VALUE = "http://xml.com/universal/images/xml_tiny.gif" - NAME_VALUE = "hogehoge" - LANGUAGE_VALUE = "ja" - DESCRIPTION_VALUE = " - XML.com features a rich mix of information and services - for the XML community. - " - RESOURCES = [ - "http://xml.com/pub/2000/08/09/xslt/xslt.html", - "http://xml.com/pub/2000/08/09/rdfdb/index.html", - ] - - CLOUD_DOMAIN = "data.ourfavoritesongs.com" - CLOUD_PORT = "80" - CLOUD_PATH = "/RPC2" - CLOUD_REGISTER_PROCEDURE = "ourFavoriteSongs.rssPleaseNotify" - CLOUD_PROTOCOL = "xml-rpc" - - ENCLOSURE_URL = "http://www.scripting.com/mp3s/weatherReportSuite.mp3" - ENCLOSURE_LENGTH = "12216320" - ENCLOSURE_TYPE = "audio/mpeg" - - CATEGORY_DOMAIN = "http://www.superopendirectory.com/" - - def default_test - # This class isn't tested - end - - private - def make_xmldecl(v=XMLDECL_VERSION, e=XMLDECL_ENCODING, s=XMLDECL_STANDALONE) - rv = "" - rv - end - - def make_RDF(content=nil, xmlns=[]) - <<-EORSS -#{make_xmldecl} - -#{block_given? ? yield : content} - -EORSS - end - - def make_channel(content=nil) - <<-EOC - - #{TITLE_VALUE} - #{LINK_VALUE} - #{DESCRIPTION_VALUE} - - - - - -#{RESOURCES.collect do |res| '' end.join("\n")} - - - - - -#{block_given? ? yield : content} - -EOC - end - - def make_image(content=nil) - <<-EOI - - #{TITLE_VALUE} - #{URL_VALUE} - #{LINK_VALUE} -#{block_given? ? yield : content} - -EOI - end - - def make_item(content=nil) - <<-EOI - - #{TITLE_VALUE} - #{LINK_VALUE} - #{DESCRIPTION_VALUE} -#{block_given? ? yield : content} - -EOI - end - - def make_textinput(content=nil) - <<-EOT - - #{TITLE_VALUE} - #{DESCRIPTION_VALUE} - #{NAME_VALUE} - #{LINK_VALUE} -#{block_given? ? yield : content} - -EOT - end - - def make_sample_RDF - make_RDF(<<-EOR) -#{make_channel} -#{make_image} -#{make_item} -#{make_textinput} -EOR - end - - def make_rss20(content=nil, xmlns=[]) - <<-EORSS -#{make_xmldecl} - -#{block_given? ? yield : content} - -EORSS - end - - def make_sample_items20 - RESOURCES.collect do |res| - elems = ["#{res}"] - elems << "title of #{res}" - elems = elems.join("\n") - item = "\n#{elems}\n" - end.join("\n") - end - - def make_channel20(content=nil) - <<-EOC - - #{TITLE_VALUE} - #{LINK_VALUE} - #{DESCRIPTION_VALUE} - #{LANGUAGE_VALUE} - - - #{RDF_RESOURCE} - #{TITLE_VALUE} - #{LINK_VALUE} - - -#{make_sample_items20} - - - #{TITLE_VALUE} - #{DESCRIPTION_VALUE} - #{NAME_VALUE} - #{RDF_RESOURCE} - - -#{block_given? ? yield : content} - -EOC - end - - def make_item20(content=nil) - <<-EOI - - #{TITLE_VALUE} - #{LINK_VALUE} - #{DESCRIPTION_VALUE} -#{block_given? ? yield : content} - -EOI - end - - def make_cloud20 - <<-EOC - -EOC - end - - def make_sample_rss20 - make_rss20(<<-EOR) -#{make_channel20} -EOR - end - - def make_element(elem_name, attrs, contents) - attrs_str = attrs.collect do |name, value| - "#{h name}='#{h value}'" - end.join(" ") - contents_str = contents.collect do |name, value| - "#{Element::INDENT}<#{h name}>#{h value}" - end.join("\n") - - "<#{h elem_name} #{attrs_str}>\n#{contents_str}\n" - end - - def xmlns_container(xmlns_decls, content) - attributes = xmlns_decls.collect do |prefix, uri| - "xmlns:#{h prefix}=\"#{h uri}\"" - end.join(" ") - "#{content}" - end - - private - def setup_dummy_channel(maker) - about = "http://hoge.com" - title = "fugafuga" - link = "http://hoge.com" - description = "fugafugafugafuga" - language = "ja" - - maker.channel.about = about - maker.channel.title = title - maker.channel.link = link - maker.channel.description = description - maker.channel.language = language - end - - def setup_dummy_image(maker) - title = "fugafuga" - link = "http://hoge.com" - url = "http://hoge.com/hoge.png" - - maker.channel.link = link if maker.channel.link.nil? - - maker.image.title = title - maker.image.url = url - end - - def setup_dummy_textinput(maker) - title = "fugafuga" - description = "text hoge fuga" - name = "hoge" - link = "http://hoge.com/search.cgi" - - maker.textinput.title = title - maker.textinput.description = description - maker.textinput.name = name - maker.textinput.link = link - end - - def setup_dummy_item(maker) - title = "TITLE" - link = "http://hoge.com/" - - item = maker.items.new_item - item.title = title - item.link = link - end - - def setup_taxo_topic(target, topics) - topics.each do |topic| - taxo_topic = target.taxo_topics.new_taxo_topic - topic.each do |name, value| - case name - when :link - taxo_topic.taxo_link = value - when :topics - value.each do |t| - taxo_topic.taxo_topics << t - end - else - dc_elems = taxo_topic.__send__("dc_#{name}s") - dc_elem = dc_elems.__send__("new_#{name}") - dc_elem.value = value - end - end - end - end - end -end -- cgit v1.2.3