summaryrefslogtreecommitdiff
path: root/test/rss
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-06 03:56:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-06 03:56:38 +0000
commit287a34ae0dfc23e4158f67cb7783d239f202c368 (patch)
tree5e35d5b41aae961b37cf6632f60c42f51c7aa775 /test/rss
parent9b52ae2e6491bb5d6c59e1799449f6268baf6f89 (diff)
* {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rss')
-rw-r--r--test/rss/rss-assertions.rb28
-rw-r--r--test/rss/rss-testcase.rb10
-rw-r--r--test/rss/test_1.0.rb90
-rw-r--r--test/rss/test_2.0.rb60
-rw-r--r--test/rss/test_accessor.rb32
-rw-r--r--test/rss/test_content.rb8
-rw-r--r--test/rss/test_maker_0.9.rb28
-rw-r--r--test/rss/test_maker_1.0.rb38
-rw-r--r--test/rss/test_maker_2.0.rb82
-rw-r--r--test/rss/test_maker_content.rb2
-rw-r--r--test/rss/test_maker_dc.rb8
-rw-r--r--test/rss/test_maker_image.rb4
-rw-r--r--test/rss/test_maker_sy.rb4
-rw-r--r--test/rss/test_maker_taxo.rb6
-rw-r--r--test/rss/test_maker_trackback.rb2
-rw-r--r--test/rss/test_maker_xml-stylesheet.rb6
-rw-r--r--test/rss/test_parser_1.0.rb2
-rw-r--r--test/rss/test_setup_maker_0.9.rb24
-rw-r--r--test/rss/test_setup_maker_1.0.rb84
-rw-r--r--test/rss/test_setup_maker_2.0.rb42
-rw-r--r--test/rss/test_setup_maker_atom_feed.rb2
-rw-r--r--test/rss/test_syndication.rb36
-rw-r--r--test/rss/test_taxonomy.rb14
-rw-r--r--test/rss/test_to_s.rb56
-rw-r--r--test/rss/test_trackback.rb28
-rw-r--r--test/rss/test_xml-stylesheet.rb12
26 files changed, 354 insertions, 354 deletions
diff --git a/test/rss/rss-assertions.rb b/test/rss/rss-assertions.rb
index 0a84e4f..86f9dd8 100644
--- a/test/rss/rss-assertions.rb
+++ b/test/rss/rss-assertions.rb
@@ -14,7 +14,7 @@ module RSS
::RSS::Parser.parse(rss, false).validate
end
end
-
+
def assert_ns(prefix, uri)
_wrap_assertion do
begin
@@ -26,7 +26,7 @@ module RSS
end
end
end
-
+
def assert_missing_tag(tag, parent)
_wrap_assertion do
begin
@@ -38,7 +38,7 @@ module RSS
end
end
end
-
+
def assert_too_much_tag(tag, parent)
_wrap_assertion do
begin
@@ -50,7 +50,7 @@ module RSS
end
end
end
-
+
def assert_missing_attribute(tag, attrname)
_wrap_assertion do
begin
@@ -62,7 +62,7 @@ module RSS
end
end
end
-
+
def assert_not_expected_tag(tag, uri, parent)
_wrap_assertion do
begin
@@ -75,7 +75,7 @@ module RSS
end
end
end
-
+
def assert_not_available_value(tag, value, attribute=nil)
_wrap_assertion do
begin
@@ -101,7 +101,7 @@ module RSS
end
end
end
-
+
def assert_xml_declaration(version, encoding, standalone, rss)
_wrap_assertion do
assert_equal(version, rss.version)
@@ -109,7 +109,7 @@ module RSS
assert_equal(standalone, rss.standalone)
end
end
-
+
def assert_xml_stylesheet_attrs(attrs, xsl)
_wrap_assertion do
n_attrs = normalized_attrs(attrs)
@@ -118,7 +118,7 @@ module RSS
end
end
end
-
+
def assert_xml_stylesheet(target, attrs, xsl)
_wrap_assertion do
if attrs.has_key?(:href)
@@ -133,7 +133,7 @@ module RSS
end
end
end
-
+
def assert_xml_stylesheet_pis(attrs_ary, rss=nil)
_wrap_assertion do
if rss.nil?
@@ -806,7 +806,7 @@ EOA
end
end
end
-
+
def assert_multiple_dublin_core(elems, target)
_wrap_assertion do
elems.each do |name, values, plural|
@@ -816,7 +816,7 @@ EOA
end
end
end
-
+
def assert_syndication(elems, target)
_wrap_assertion do
elems.each do |name, value|
@@ -826,7 +826,7 @@ EOA
end
end
end
-
+
def assert_content(elems, target)
_wrap_assertion do
elems.each do |name, value|
@@ -834,7 +834,7 @@ EOA
end
end
end
-
+
def assert_trackback(attrs, target)
_wrap_assertion do
n_attrs = normalized_attrs(attrs)
diff --git a/test/rss/rss-testcase.rb b/test/rss/rss-testcase.rb
index 79f8cb8..6a7093a 100644
--- a/test/rss/rss-testcase.rb
+++ b/test/rss/rss-testcase.rb
@@ -37,11 +37,11 @@ module RSS
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/"
FEED_TITLE = "dive into mark"
@@ -375,7 +375,7 @@ EOA
rdf.items << item
assert_not_equal("", rdf.to_s)
end
-
+
def setup_rss20(rss)
assert_equal("", rss.to_s)
@@ -389,7 +389,7 @@ EOA
rss.channel = channel
assert_not_equal("", rss.to_s)
end
-
+
def setup_dummy_channel(maker)
about = "http://hoge.com"
title = "fugafuga"
@@ -421,7 +421,7 @@ EOA
url = "http://hoge.com/hoge.png"
maker.channel.link = link if maker.channel.link.nil?
-
+
maker.image.title = title
maker.image.url = url
end
diff --git a/test/rss/test_1.0.rb b/test/rss/test_1.0.rb
index 9cb7607..52ad24c 100644
--- a/test/rss/test_1.0.rb
+++ b/test/rss/test_1.0.rb
@@ -6,32 +6,32 @@ require "rss/1.0"
module RSS
class TestRSS10Core < TestCase
-
+
def setup
@rdf_prefix = "rdf"
@rdf_uri = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
@uri = "http://purl.org/rss/1.0/"
end
-
+
def test_RDF
version = "1.0"
encoding = "UTF-8"
standalone = false
-
+
rdf = RDF.new(version, encoding, standalone)
setup_rss10(rdf)
doc = REXML::Document.new(rdf.to_s)
-
+
xmldecl = doc.xml_decl
-
+
%w(version encoding).each do |x|
assert_equal(instance_eval(x), xmldecl.__send__(x))
end
assert_equal(standalone, !xmldecl.standalone.nil?)
-
+
assert_equal(@rdf_uri, doc.root.namespace)
end
-
+
def test_not_displayed_xml_stylesheets
rdf = RDF.new()
plain_rdf = rdf.to_s
@@ -40,7 +40,7 @@ module RSS
assert_equal(plain_rdf, rdf.to_s)
end
end
-
+
def test_xml_stylesheets
[
[{:href => "a.xsl", :type => "text/xsl"}],
@@ -52,7 +52,7 @@ module RSS
assert_xml_stylesheet_pis(attrs_ary)
end
end
-
+
def test_channel
about = "http://hoge.com"
title = "fugafuga"
@@ -77,7 +77,7 @@ module RSS
%w(title link description image items textinput).each do |x|
channel.__send__("#{x}=", instance_eval(x))
end
-
+
doc = REXML::Document.new(make_RDF(<<-EOR))
#{channel}
<items>
@@ -85,7 +85,7 @@ module RSS
</items>
EOR
c = doc.root.elements[1]
-
+
assert_equal(about, c.attributes["about"])
%w(title link description image textinput).each do |x|
elem = c.elements[x]
@@ -105,52 +105,52 @@ EOR
assert_equal(@uri, c.elements["items"].namespace)
assert_equal("items", c.elements["items"].name)
end
-
+
def test_channel_image
resource = "http://hoge.com/hoge.png"
image = RDF::Channel::Image.new(resource)
-
+
doc = REXML::Document.new(make_RDF(image.to_s))
i = doc.root.elements[1]
-
+
assert_equal("image", i.name)
assert_equal(@uri, i.namespace)
-
+
res = i.attributes.get_attribute("resource")
-
+
assert_equal(@rdf_uri, res.namespace)
assert_equal(resource, res.value)
end
-
+
def test_channel_textinput
resource = "http://hoge.com/hoge.png"
textinput = RDF::Channel::Textinput.new(resource)
-
+
doc = REXML::Document.new(make_RDF(textinput.to_s))
t = doc.root.elements[1]
-
+
assert_equal("textinput", t.name)
assert_equal(@uri, t.namespace)
-
+
res = t.attributes.get_attribute("resource")
-
+
assert_equal(@rdf_uri, res.namespace)
assert_equal(resource, res.value)
end
-
+
def test_channel_items
item_link = "http://example.com/item"
items = RDF::Channel::Items.new
li = items.Seq.class::Li.new(item_link)
items.Seq.lis << li
-
+
doc = REXML::Document.new(make_RDF(items.to_s))
i = doc.root.elements[1]
-
+
assert_equal("items", i.name)
assert_equal(@uri, i.namespace)
-
+
assert_equal(1, i.elements.size)
seq = i.elements[1]
assert_equal("Seq", seq.name)
@@ -162,16 +162,16 @@ EOR
assert_equal(@rdf_uri, l.namespace)
assert_equal(item_link, l.attributes["resource"])
end
-
+
def test_seq
item_link = "http://example.com/item"
seq = RDF::Seq.new
li = seq.class::Li.new(item_link)
seq.lis << li
-
+
doc = REXML::Document.new(make_RDF(seq.to_s))
s = doc.root.elements[1]
-
+
assert_equal("Seq", s.name)
assert_equal(@rdf_uri, s.namespace)
@@ -181,37 +181,37 @@ EOR
assert_equal(@rdf_uri, l.namespace)
assert_equal(item_link, l.attributes["resource"])
end
-
+
def test_li
resource = "http://hoge.com/"
li = RDF::Li.new(resource)
-
+
doc = REXML::Document.new(make_RDF(li.to_s))
l = doc.root.elements[1]
-
+
assert_equal("li", l.name)
assert_equal(@rdf_uri, l.namespace(l.prefix))
-
+
res = l.attributes.get_attribute("resource")
-
+
assert_equal('', res.instance_eval("@prefix"))
assert_equal(resource, res.value)
end
-
+
def test_image
about = "http://hoge.com"
title = "fugafuga"
url = "http://hoge.com/hoge"
link = "http://hoge.com/fuga"
-
+
image = RDF::Image.new(about)
%w(title url link).each do |x|
image.__send__("#{x}=", instance_eval(x))
end
-
+
doc = REXML::Document.new(make_RDF(image.to_s))
i = doc.root.elements[1]
-
+
assert_equal(about, i.attributes["about"])
%w(title url link).each do |x|
elem = i.elements[x]
@@ -220,21 +220,21 @@ EOR
assert_equal(instance_eval(x), elem.text)
end
end
-
+
def test_item
about = "http://hoge.com"
title = "fugafuga"
link = "http://hoge.com/fuga"
description = "hogehogehoge"
-
+
item = RDF::Item.new(about)
%w(title link description).each do |x|
item.__send__("#{x}=", instance_eval(x))
end
-
+
doc = REXML::Document.new(make_RDF(item.to_s))
i = doc.root.elements[1]
-
+
assert_equal(about, i.attributes["about"])
%w(title link description).each do |x|
elem = i.elements[x]
@@ -243,22 +243,22 @@ EOR
assert_equal(instance_eval(x), elem.text)
end
end
-
+
def test_textinput
about = "http://hoge.com"
title = "fugafuga"
link = "http://hoge.com/fuga"
name = "foo"
description = "hogehogehoge"
-
+
textinput = RDF::Textinput.new(about)
%w(title link name description).each do |x|
textinput.__send__("#{x}=", instance_eval(x))
end
-
+
doc = REXML::Document.new(make_RDF(textinput.to_s))
t = doc.root.elements[1]
-
+
assert_equal(about, t.attributes["about"])
%w(title link name description).each do |x|
elem = t.elements[x]
diff --git a/test/rss/test_2.0.rb b/test/rss/test_2.0.rb
index 5a63efb..884afcc 100644
--- a/test/rss/test_2.0.rb
+++ b/test/rss/test_2.0.rb
@@ -8,28 +8,28 @@ module RSS
def setup
@rss_version = "2.0"
end
-
+
def test_Rss
version = "1.0"
encoding = "UTF-8"
standalone = false
-
+
rss = Rss.new(@rss_version, version, encoding, standalone)
setup_rss20(rss)
-
+
doc = REXML::Document.new(rss.to_s(false))
-
+
xmldecl = doc.xml_decl
-
+
%w(version encoding).each do |x|
assert_equal(instance_eval(x), xmldecl.__send__(x))
end
assert_equal(standalone, !xmldecl.standalone.nil?)
-
+
assert_equal("", doc.root.namespace)
assert_equal(@rss_version, doc.root.attributes["version"])
end
-
+
def test_not_displayed_xml_stylesheets
rss = Rss.new(@rss_version)
plain_rss = rss.to_s
@@ -38,7 +38,7 @@ module RSS
assert_equal(plain_rss, rss.to_s)
end
end
-
+
def test_xml_stylesheets
[
[{:href => "a.xsl", :type => "text/xsl"}],
@@ -57,7 +57,7 @@ module RSS
title = "fugafuga"
link = "http://hoge.com"
description = "fugafugafugafuga"
-
+
language = "en-us"
copyright = "Copyright 2002, Spartanburg Herald-Journal"
managingEditor = "geo@herald.com (George Matesky)"
@@ -81,7 +81,7 @@ module RSS
rating = '(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l gen true comment "RSACi North America Server" for "http://www.rsac.org" on "1996.04.16T08:15-0500" r (n 0 s 0 v 0 l 0))'
channel = Rss::Channel.new
-
+
elems = %w(title link description language copyright
managingEditor webMaster pubDate lastBuildDate
generator docs ttl rating)
@@ -94,10 +94,10 @@ module RSS
channel.categories << Rss::Channel::Category.new(cat[:domain],
cat[:content])
end
-
+
doc = REXML::Document.new(make_rss20(channel.to_s))
c = doc.root.elements[1]
-
+
elems.each do |x|
elem = c.elements[x]
assert_equal(x, elem.name)
@@ -139,10 +139,10 @@ module RSS
cloud_params[:registerProcedure],
cloud_params[:protocol])
cloud_params[:port] = cloud.port
-
+
doc = REXML::Document.new(cloud.to_s)
cloud_elem = doc.root
-
+
actual = {}
cloud_elem.attributes.each do |name, value|
value = value.to_i if name == "port"
@@ -169,7 +169,7 @@ module RSS
doc = REXML::Document.new(image.to_s)
image_elem = doc.root
-
+
image_params.each do |name, value|
value = image.__send__(name)
actual = image_elem.elements[name.to_s].text
@@ -177,7 +177,7 @@ module RSS
assert_equal(value, actual)
end
end
-
+
def test_channel_textInput
textInput_params = {
:title => "fugafuga",
@@ -192,13 +192,13 @@ module RSS
doc = REXML::Document.new(textInput.to_s)
input_elem = doc.root
-
+
textInput_params.each do |name, value|
actual = input_elem.elements[name.to_s].text
assert_equal(value, actual)
end
end
-
+
def test_channel_skip_days
skipDays_values = [
"Sunday",
@@ -208,15 +208,15 @@ module RSS
skipDays_values.each do |value|
skipDays.days << Rss::Channel::SkipDays::Day.new(value)
end
-
+
doc = REXML::Document.new(skipDays.to_s)
days_elem = doc.root
-
+
skipDays_values.each_with_index do |value, i|
assert_equal(value, days_elem.elements[i + 1].text)
end
end
-
+
def test_channel_skip_hours
skipHours_values = [
"0",
@@ -229,7 +229,7 @@ module RSS
doc = REXML::Document.new(skipHours.to_s)
hours_elem = doc.root
-
+
skipHours_values.each_with_index do |value, i|
expected = skipHours.hours[i].content
assert_equal(expected, hours_elem.elements[i + 1].text.to_i)
@@ -260,7 +260,7 @@ module RSS
item = Rss::Channel::Item.new
channel.items << item
-
+
elems = %w(title link description author comments pubDate)
elems.each do |x|
value = instance_eval(x)
@@ -271,7 +271,7 @@ module RSS
item.categories << Rss::Channel::Category.new(cat[:domain],
cat[:content])
end
-
+
doc = REXML::Document.new(channel.to_s)
channel_elem = doc.root
@@ -311,7 +311,7 @@ module RSS
enclosure_params[:length],
enclosure_params[:type])
enclosure_params[:length] = enclosure.length
-
+
doc = REXML::Document.new(enclosure.to_s)
enclosure_elem = doc.root
@@ -322,7 +322,7 @@ module RSS
end
assert_equal(enclosure_params, actual)
end
-
+
def test_item_guid
test_params = [
{
@@ -345,10 +345,10 @@ module RSS
else
assert_equal(guid.isPermaLink, guid.PermaLink?)
end
-
+
doc = REXML::Document.new(guid.to_s)
guid_elem = doc.root
-
+
actual = {}
actual[:content] = guid_elem.text if guid_elem.text
guid_elem.attributes.each do |name, value|
@@ -358,7 +358,7 @@ module RSS
assert_equal(guid_params, actual)
end
end
-
+
def test_item_source
source_params = {
:url => "http://www.tomalak.org/links2.xml",
@@ -370,7 +370,7 @@ module RSS
doc = REXML::Document.new(source.to_s)
source_elem = doc.root
-
+
actual = {}
actual[:content] = source_elem.text
source_elem.attributes.each do |name, value|
diff --git a/test/rss/test_accessor.rb b/test/rss/test_accessor.rb
index ceb31fc..f2b8508 100644
--- a/test/rss/test_accessor.rb
+++ b/test/rss/test_accessor.rb
@@ -11,11 +11,11 @@ module RSS
channel = Rss::Channel.new
channel.pubDate = nil
assert_nil(channel.pubDate)
-
+
time = Time.now
channel.pubDate = time
assert_equal(time, channel.pubDate)
-
+
time = Time.parse(Time.now.rfc822)
channel.pubDate = time.rfc822
assert_equal(time, channel.pubDate)
@@ -25,35 +25,35 @@ module RSS
assert_not_available_value("pubDate", value) do
channel.pubDate = value
end
-
+
channel.do_validate = false
time = Time.parse(Time.now.iso8601)
value = time.iso8601
channel.pubDate = value
assert_equal(time, channel.pubDate)
-
+
channel.pubDate = nil
assert_nil(channel.pubDate)
end
-
+
def test_integer
image_item = RDF::Item::ImageItem.new
image_item.width = nil
assert_nil(image_item.width)
-
+
width = 10
image_item.width = width
assert_equal(width, image_item.width)
-
+
width = 10.0
image_item.width = width
assert_equal(width, image_item.width)
-
+
width = "10"
image_item.width = width
assert_equal(width.to_i, image_item.width)
-
+
width = "10.0"
assert_not_available_value("image:width", width) do
image_item.width = width
@@ -63,29 +63,29 @@ module RSS
width = "10.0"
image_item.width = width
assert_equal(width.to_i, image_item.width)
-
+
image_item.width = nil
assert_nil(image_item.width)
end
-
+
def test_positive_integer
channel = RDF::Channel.new
channel.sy_updateFrequency = nil
assert_nil(channel.sy_updateFrequency)
-
+
freq = 10
channel.sy_updateFrequency = freq
assert_equal(freq, channel.sy_updateFrequency)
-
+
freq = 10.0
channel.sy_updateFrequency = freq
assert_equal(freq, channel.sy_updateFrequency)
-
+
freq = "10"
channel.sy_updateFrequency = freq
assert_equal(freq.to_i, channel.sy_updateFrequency)
-
+
freq = "10.0"
assert_not_available_value("sy:updateFrequency", freq) do
channel.sy_updateFrequency = freq
@@ -95,7 +95,7 @@ module RSS
freq = "10.0"
channel.sy_updateFrequency = freq
assert_equal(freq.to_i, channel.sy_updateFrequency)
-
+
channel.sy_updateFrequency = nil
assert_nil(channel.sy_updateFrequency)
end
diff --git a/test/rss/test_content.rb b/test/rss/test_content.rb
index 02db591..f59b0c8 100644
--- a/test/rss/test_content.rb
+++ b/test/rss/test_content.rb
@@ -10,15 +10,15 @@ module RSS
def setup
@prefix = "content"
@uri = "http://purl.org/rss/1.0/modules/content/"
-
+
@elems = {
:encoded => "<em>ATTENTION</em>",
}
-
+
@content_nodes = @elems.collect do |name, value|
"<#{@prefix}:#{name}>#{CGI.escapeHTML(value.to_s)}</#{@prefix}:#{name}>"
end.join("\n")
-
+
@rss10_source = make_RDF(<<-EOR, {@prefix => @uri})
#{make_channel()}
#{make_image()}
@@ -79,7 +79,7 @@ EOR
end
end
end
-
+
def test_to_s
@elems.each do |name, value|
excepted = make_element("#{@prefix}:#{name}", {}, value)
diff --git a/test/rss/test_maker_0.9.rb b/test/rss/test_maker_0.9.rb
index f397f92..61b272d 100644
--- a/test/rss/test_maker_0.9.rb
+++ b/test/rss/test_maker_0.9.rb
@@ -16,20 +16,20 @@ module RSS
assert_raise(LocalJumpError) do
RSS::Maker.make("0.91")
end
-
+
rss = RSS::Maker.make("0.9") do |maker|
setup_dummy_channel(maker)
setup_dummy_image(maker)
end
assert_equal("0.92", rss.rss_version)
-
+
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
setup_dummy_image(maker)
end
assert_equal("0.91", rss.rss_version)
-
+
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
setup_dummy_image(maker)
@@ -112,7 +112,7 @@ module RSS
maker.image.title = image_title
end
channel = rss.channel
-
+
assert_equal(title, channel.title)
assert_equal(link, channel.link)
assert_equal(description, channel.description)
@@ -132,7 +132,7 @@ module RSS
skipHours.each_with_index do |hour, i|
assert_equal(hour.to_i, channel.skipHours.hours[i].content)
end
-
+
assert(channel.items.empty?)
assert_equal(image_url, channel.image.url)
@@ -185,7 +185,7 @@ module RSS
end
end
end
-
+
def test_image
title = "fugafuga"
link = "http://hoge.com"
@@ -197,7 +197,7 @@ module RSS
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
@@ -216,7 +216,7 @@ module RSS
RSS::Maker.make("0.91") do |maker|
# setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
@@ -252,7 +252,7 @@ module RSS
setup_dummy_channel(maker)
# maker.channel.link = link
maker.channel.link = nil
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
@@ -274,7 +274,7 @@ module RSS
end
end
end
-
+
def test_items(with_convenience_way=true)
title = "TITLE"
link = "http://hoge.com/"
@@ -288,7 +288,7 @@ module RSS
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
-
+
maker.items.new_item do |item|
item.title = title
item.link = link
@@ -307,7 +307,7 @@ module RSS
item_size = 5
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |_item|
_item.title = "#{title}#{i}"
@@ -328,7 +328,7 @@ module RSS
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |_item|
_item.title = "#{title}#{i}"
@@ -391,7 +391,7 @@ module RSS
end
end
end
-
+
def test_not_valid_textInput
title = "fugafuga"
description = "text hoge fuga"
diff --git a/test/rss/test_maker_1.0.rb b/test/rss/test_maker_1.0.rb
index bee3206..ab6f6ad 100644
--- a/test/rss/test_maker_1.0.rb
+++ b/test/rss/test_maker_1.0.rb
@@ -19,7 +19,7 @@ module RSS
setup_dummy_item(maker)
end
assert_equal("1.0", rss.rss_version)
-
+
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
maker.encoding = "EUC-JP"
@@ -137,8 +137,8 @@ module RSS
end
end
end
-
-
+
+
def test_image
title = "fugafuga"
link = "http://hoge.com"
@@ -147,7 +147,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
@@ -164,7 +164,7 @@ module RSS
RSS::Maker.make("1.0") do |maker|
# setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
end
@@ -179,7 +179,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
# maker.image.url = url
maker.image.title = title
@@ -191,7 +191,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.url = url
# maker.image.title = title
@@ -205,7 +205,7 @@ module RSS
setup_dummy_channel(maker)
# maker.channel.link = link
maker.channel.link = nil
-
+
maker.image.url = url
maker.image.title = title
@@ -227,7 +227,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.items.new_item do |item|
item.title = title
item.link = link
@@ -241,11 +241,11 @@ module RSS
assert_equal(link, item.link)
assert_nil(item.description)
-
+
item_size = 5
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |_item|
_item.title = "#{title}#{i}"
@@ -265,7 +265,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |_item|
_item.title = "#{title}#{i}"
@@ -292,7 +292,7 @@ module RSS
max_size = item_size / 2
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |_item|
_item.title = "#{title}#{i}"
@@ -329,7 +329,7 @@ module RSS
max_size = -2
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |_item|
_item.title = "#{title}#{i}"
@@ -398,7 +398,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.link = link
maker.textinput.title = title
maker.textinput.description = description
@@ -425,7 +425,7 @@ module RSS
end
end
end
-
+
def test_not_valid_textinput
title = "fugafuga"
description = "text hoge fuga"
@@ -447,7 +447,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.link = link
# maker.textinput.title = title
maker.textinput.description = description
@@ -460,7 +460,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.link = link
maker.textinput.title = title
# maker.textinput.description = description
@@ -473,7 +473,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.link = link
maker.textinput.title = title
maker.textinput.description = description
diff --git a/test/rss/test_maker_2.0.rb b/test/rss/test_maker_2.0.rb
index 9fe6543..7285f11 100644
--- a/test/rss/test_maker_2.0.rb
+++ b/test/rss/test_maker_2.0.rb
@@ -13,15 +13,15 @@ module RSS
assert_raise(LocalJumpError) do
RSS::Maker.make("2.0")
end
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
end
assert_equal("2.0", rss.rss_version)
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.encoding = "EUC-JP"
end
assert_equal("2.0", rss.rss_version)
@@ -29,7 +29,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.standalone = "yes"
end
assert_equal("2.0", rss.rss_version)
@@ -37,7 +37,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.encoding = "EUC-JP"
maker.standalone = "yes"
end
@@ -72,7 +72,7 @@ module RSS
]
generator = "RSS Maker"
ttl = "60"
-
+
rss = RSS::Maker.make("2.0") do |maker|
maker.channel.title = title
maker.channel.link = link
@@ -96,18 +96,18 @@ module RSS
new_hour.content = hour
end
end
-
+
categories.each do |category|
maker.channel.categories.new_category do |new_category|
new_category.content = category
end
end
-
+
maker.channel.generator = generator
maker.channel.ttl = ttl
end
channel = rss.channel
-
+
assert_equal(title, channel.title)
assert_equal(link, channel.link)
assert_equal(description, channel.description)
@@ -127,11 +127,11 @@ module RSS
skipHours.each_with_index do |hour, i|
assert_equal(hour.to_i, channel.skipHours.hours[i].content)
end
-
+
channel.categories.each_with_index do |category, i|
assert_equal(categories[i], category.content)
end
-
+
assert_equal(generator, channel.generator)
assert_equal(ttl.to_i, channel.ttl)
@@ -145,7 +145,7 @@ module RSS
link = "http://hoge.com"
description = "fugafugafugafuga"
language = "ja"
-
+
assert_not_set_error("maker.channel", %w(title)) do
RSS::Maker.make("2.0") do |maker|
# maker.channel.title = title
@@ -182,7 +182,7 @@ module RSS
assert_not_nil(rss)
end
-
+
def test_cloud
domain = "rpc.sys.com"
port = "80"
@@ -206,7 +206,7 @@ module RSS
assert_equal(registerProcedure, cloud.registerProcedure)
assert_equal(protocol, cloud.protocol)
end
-
+
def test_not_valid_cloud
domain = "rpc.sys.com"
port = "80"
@@ -269,7 +269,7 @@ module RSS
end
assert_nil(rss.channel.cloud)
end
-
+
def test_image
title = "fugafuga"
@@ -282,7 +282,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
@@ -301,7 +301,7 @@ module RSS
RSS::Maker.make("2.0") do |maker|
# setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
@@ -322,7 +322,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
# maker.image.title = title
maker.image.url = url
maker.image.width = width
@@ -336,7 +336,7 @@ module RSS
setup_dummy_channel(maker)
# maker.channel.link = link
maker.channel.link = nil
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
@@ -348,7 +348,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
# maker.image.url = url
maker.image.width = width
@@ -357,7 +357,7 @@ module RSS
end
assert_nil(rss.image)
end
-
+
def test_items(with_convenience_way=true)
title = "TITLE"
link = "http://hoge.com/"
@@ -374,7 +374,7 @@ module RSS
item_size = 5
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |item|
item.title = "#{title}#{i}"
@@ -400,7 +400,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |item|
item.title = "#{title}#{i}"
@@ -467,7 +467,7 @@ module RSS
def test_guid
isPermaLink = "true"
content = "http://inessential.com/2002/09/01.php#a2"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -483,7 +483,7 @@ module RSS
def test_not_valid_guid
content = "http://inessential.com/2002/09/01.php#a2"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -493,12 +493,12 @@ module RSS
end
assert_nil(rss.channel.items.last.guid)
end
-
+
def test_enclosure
url = "http://www.scripting.com/mp3s/weatherReportSuite.mp3"
length = "12216320"
type = "audio/mpeg"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -518,7 +518,7 @@ module RSS
url = "http://www.scripting.com/mp3s/weatherReportSuite.mp3"
length = "12216320"
type = "audio/mpeg"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -529,7 +529,7 @@ module RSS
enclosure.type = type
end
assert_nil(rss.channel.items.last.enclosure)
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -540,7 +540,7 @@ module RSS
enclosure.type = type
end
assert_nil(rss.channel.items.last.enclosure)
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -557,7 +557,7 @@ module RSS
def test_source
url = "http://static.userland.com/tomalak/links2.xml"
content = "Tomalak's Realm"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -574,7 +574,7 @@ module RSS
def test_not_valid_source
url = "http://static.userland.com/tomalak/links2.xml"
content = "Tomalak's Realm"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -584,7 +584,7 @@ module RSS
source.content = content
end
assert_nil(rss.channel.items.last.source)
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -595,11 +595,11 @@ module RSS
end
assert_nil(rss.channel.items.last.source)
end
-
+
def test_category
domain = "http://www.fool.com/cusips"
content = "MSFT"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -616,7 +616,7 @@ module RSS
def test_not_valid_category
content = "Grateful Dead"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -627,7 +627,7 @@ module RSS
end
assert(rss.channel.items.last.categories.empty?)
end
-
+
def test_textInput
title = "fugafuga"
description = "text hoge fuga"
@@ -659,7 +659,7 @@ module RSS
end
end
end
-
+
def test_not_valid_textInput
title = "fugafuga"
description = "text hoge fuga"
@@ -678,7 +678,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.title = title
# maker.textinput.description = description
maker.textinput.name = name
@@ -688,7 +688,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.title = title
maker.textinput.description = description
# maker.textinput.name = name
@@ -698,7 +698,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.title = title
maker.textinput.description = description
maker.textinput.name = name
diff --git a/test/rss/test_maker_content.rb b/test/rss/test_maker_content.rb
index 53750bb..393adcb 100644
--- a/test/rss/test_maker_content.rb
+++ b/test/rss/test_maker_content.rb
@@ -7,7 +7,7 @@ module RSS
def setup
@uri = "http://purl.org/rss/1.0/modules/content/"
-
+
@elements = {
:encoded => "<em>ATTENTION</em>",
}
diff --git a/test/rss/test_maker_dc.rb b/test/rss/test_maker_dc.rb
index 72a9672..626ec8d 100644
--- a/test/rss/test_maker_dc.rb
+++ b/test/rss/test_maker_dc.rb
@@ -7,12 +7,12 @@ module RSS
def setup
@uri = "http://purl.org/dc/elements/1.1/"
-
+
t = Time.iso8601("2000-01-01T12:00:05+00:00")
class << t
alias_method(:to_s, :iso8601)
end
-
+
@elements = {
:title => "hoge",
:description =>
@@ -103,7 +103,7 @@ module RSS
def test_date
t1 = Time.iso8601("2000-01-01T12:00:05+00:00")
t2 = Time.iso8601("2005-01-01T12:00:05+00:00")
-
+
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
maker.channel.date = t1
@@ -121,7 +121,7 @@ module RSS
assert_equal([t1, t2], rss.channel.dc_dates.collect{|x| x.value})
assert_equal([t2, t1], rss.items.last.dc_dates.collect{|x| x.value})
end
-
+
private
def accessor_name(name)
"dc_#{name}"
diff --git a/test/rss/test_maker_image.rb b/test/rss/test_maker_image.rb
index 1fc8076..4fba2cf 100644
--- a/test/rss/test_maker_image.rb
+++ b/test/rss/test_maker_image.rb
@@ -39,7 +39,7 @@ module RSS
setup_dummy_textinput(maker)
end
-
+
setup_rss = RSS::Maker.make("1.0") do |maker|
rss.setup_maker(maker)
end
@@ -49,7 +49,7 @@ module RSS
assert_equal(@favicon_infos["about"], favicon.about)
assert_equal(@favicon_infos["image_size"], favicon.image_size)
assert_equal(@favicon_infos["dc_title"], favicon.dc_title)
-
+
item = target.items.last.image_item
assert_equal(@item_infos["about"], item.about)
assert_equal(@item_infos["resource"], item.resource)
diff --git a/test/rss/test_maker_sy.rb b/test/rss/test_maker_sy.rb
index 309a3b7..3f026b5 100644
--- a/test/rss/test_maker_sy.rb
+++ b/test/rss/test_maker_sy.rb
@@ -7,12 +7,12 @@ module RSS
def setup
@uri = "http://purl.org/rss/1.0/modules/syndication/"
-
+
t = Time.iso8601("2000-01-01T12:00:05+00:00")
class << t
alias_method(:to_s, :iso8601)
end
-
+
@elements = {
:updatePeriod => "hourly",
:updateFrequency => "2",
diff --git a/test/rss/test_maker_taxo.rb b/test/rss/test_maker_taxo.rb
index 8feb4e1..c5cf18a 100644
--- a/test/rss/test_maker_taxo.rb
+++ b/test/rss/test_maker_taxo.rb
@@ -7,7 +7,7 @@ module RSS
def setup
@uri = "http://purl.org/rss/1.0/modules/taxonomy/"
-
+
@resources = [
"http://meerkat.oreillynet.com/?c=cat23",
"http://meerkat.oreillynet.com/?c=47",
@@ -52,7 +52,7 @@ module RSS
def _test_date
t1 = Time.iso8601("2000-01-01T12:00:05+00:00")
t2 = Time.iso8601("2005-01-01T12:00:05+00:00")
-
+
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
maker.channel.date = t1
@@ -70,7 +70,7 @@ module RSS
assert_equal([t1, t2], rss.channel.dc_dates.collect{|x| x.value})
assert_equal([t2, t1], rss.items.last.dc_dates.collect{|x| x.value})
end
-
+
private
def set_topics(target, resources=@resources)
resources.each do |value|
diff --git a/test/rss/test_maker_trackback.rb b/test/rss/test_maker_trackback.rb
index 58705c6..d9fe2ad 100644
--- a/test/rss/test_maker_trackback.rb
+++ b/test/rss/test_maker_trackback.rb
@@ -7,7 +7,7 @@ module RSS
def setup
@uri = "http://madskills.com/public/xml/rss/module/trackback/"
-
+
@elements = {
:ping => "http://bar.com/tb.cgi?tb_id=rssplustrackback",
:abouts => [
diff --git a/test/rss/test_maker_xml-stylesheet.rb b/test/rss/test_maker_xml-stylesheet.rb
index 81d97dd..c1dd6f7 100644
--- a/test/rss/test_maker_xml-stylesheet.rb
+++ b/test/rss/test_maker_xml-stylesheet.rb
@@ -35,7 +35,7 @@ module RSS
assert_equal(charset, xss.charset)
assert_equal(alternate, xss.alternate)
-
+
href = 'http://example.com/index.xsl'
type = 'text/xsl'
rss = RSS::Maker.make("1.0") do |maker|
@@ -55,7 +55,7 @@ module RSS
def test_not_valid_xml_stylesheet
href = 'xss.XXX'
type = "text/xsl"
-
+
rss = RSS::Maker.make("1.0") do |maker|
maker.xml_stylesheets.new_xml_stylesheet do |xss|
# xss.href = href
@@ -78,6 +78,6 @@ module RSS
end
assert(rss.xml_stylesheets.empty?)
end
-
+
end
end
diff --git a/test/rss/test_parser_1.0.rb b/test/rss/test_parser_1.0.rb
index 216881b..ddc82b1 100644
--- a/test/rss/test_parser_1.0.rb
+++ b/test/rss/test_parser_1.0.rb
@@ -484,7 +484,7 @@ EOR
assert_not_expected_tag(name, uri, "image") do
Parser.parse(rss, true, false)
end
-
+
uri = CONTENT_URI
name = "encoded"
elem = "<#{name} xmlns='#{uri}'/>"
diff --git a/test/rss/test_setup_maker_0.9.rb b/test/rss/test_setup_maker_0.9.rb
index c20186c..0bcb0cb 100644
--- a/test/rss/test_setup_maker_0.9.rb
+++ b/test/rss/test_setup_maker_0.9.rb
@@ -64,7 +64,7 @@ module RSS
setup_dummy_image(maker)
end
channel = new_rss.channel
-
+
assert_equal(title, channel.title)
assert_equal(link, channel.link)
assert_equal(description, channel.description)
@@ -99,19 +99,19 @@ module RSS
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
maker.image.height = height
maker.image.description = description
end
-
+
new_rss = RSS::Maker.make("0.91") do |maker|
rss.channel.setup_maker(maker)
rss.image.setup_maker(maker)
end
-
+
image = new_rss.image
assert_equal(title, image.title)
assert_equal(link, image.link)
@@ -120,7 +120,7 @@ module RSS
assert_equal(height.to_i, image.height)
assert_equal(description, image.description)
end
-
+
def test_setup_maker_textinput
title = "fugafuga"
description = "text hoge fuga"
@@ -142,7 +142,7 @@ module RSS
rss.image.setup_maker(maker)
rss.textinput.setup_maker(maker)
end
-
+
textInput = new_rss.channel.textInput
assert_equal(title, textInput.title)
assert_equal(description, textInput.description)
@@ -156,10 +156,10 @@ module RSS
description = "text hoge fuga"
item_size = 5
-
+
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |item|
item.title = "#{title}#{i}"
@@ -170,7 +170,7 @@ module RSS
setup_dummy_image(maker)
end
-
+
new_rss = RSS::Maker.make("0.91") do |maker|
rss.channel.setup_maker(maker)
@@ -196,11 +196,11 @@ module RSS
def test_setup_maker_items_backward_compatibility
test_setup_maker_items(true)
end
-
+
def test_setup_maker
encoding = "EUC-JP"
standalone = true
-
+
href = 'a.xsl'
type = 'text/xsl'
title = 'sample'
@@ -228,7 +228,7 @@ module RSS
new_rss = RSS::Maker.make("0.91") do |maker|
rss.setup_maker(maker)
end
-
+
assert_equal("0.91", new_rss.rss_version)
assert_equal(encoding, new_rss.encoding)
assert_equal(standalone, new_rss.standalone)
diff --git a/test/rss/test_setup_maker_1.0.rb b/test/rss/test_setup_maker_1.0.rb
index 0b960d9..9f7bb1c 100644
--- a/test/rss/test_setup_maker_1.0.rb
+++ b/test/rss/test_setup_maker_1.0.rb
@@ -10,7 +10,7 @@ module RSS
class << t
alias_method(:to_s, :iso8601)
end
-
+
@dc_elems = {
:title => "hoge",
:description =>
@@ -39,7 +39,7 @@ module RSS
@content_elems = {
:encoded => "<em>ATTENTION</em>",
}
-
+
@trackback_elems = {
:ping => "http://bar.com/tb.cgi?tb_id=rssplustrackback",
:about => [
@@ -67,7 +67,7 @@ module RSS
},
]
end
-
+
def test_setup_maker_channel
about = "http://hoge.com"
title = "fugafuga"
@@ -79,7 +79,7 @@ module RSS
maker.channel.title = title
maker.channel.link = link
maker.channel.description = description
-
+
@dc_elems.each do |var, value|
maker.channel.__send__("dc_#{var}=", value)
end
@@ -98,7 +98,7 @@ module RSS
end
end
channel = new_rss.channel
-
+
assert_equal(about, channel.about)
assert_equal(title, channel.title)
assert_equal(link, channel.link)
@@ -110,23 +110,23 @@ module RSS
@dc_elems.each do |var, value|
assert_equal(value, channel.__send__("dc_#{var}"))
end
-
+
@sy_elems.each do |var, value|
value = value.to_i if var == :updateFrequency
assert_equal(value, channel.__send__("sy_#{var}"))
end
-
+
end
def test_setup_maker_image
title = "fugafuga"
link = "http://hoge.com"
url = "http://hoge.com/hoge.png"
-
+
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
@@ -136,7 +136,7 @@ module RSS
setup_dummy_item(maker)
end
-
+
new_rss = RSS::Maker.make("1.0") do |maker|
rss.channel.setup_maker(maker)
rss.image.setup_maker(maker)
@@ -144,7 +144,7 @@ module RSS
item.setup_maker(maker)
end
end
-
+
image = new_rss.image
assert_equal(url, image.about)
assert_equal(url, new_rss.channel.image.resource)
@@ -156,7 +156,7 @@ module RSS
assert_equal(image.__send__("dc_#{var}"), value)
end
end
-
+
def test_setup_maker_textinput
title = "fugafuga"
description = "text hoge fuga"
@@ -165,7 +165,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.link = link
maker.textinput.title = title
maker.textinput.description = description
@@ -177,7 +177,7 @@ module RSS
setup_dummy_item(maker)
end
-
+
new_rss = RSS::Maker.make("1.0") do |maker|
rss.channel.setup_maker(maker)
rss.textinput.setup_maker(maker)
@@ -185,7 +185,7 @@ module RSS
item.setup_maker(maker)
end
end
-
+
textinput = new_rss.textinput
assert_equal(link, textinput.about)
assert_equal(link, new_rss.channel.textinput.resource)
@@ -205,10 +205,10 @@ module RSS
description = "text hoge fuga"
item_size = 5
-
+
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |item|
item.title = "#{title}#{i}"
@@ -232,7 +232,7 @@ module RSS
end
end
end
-
+
new_rss = RSS::Maker.make("1.0") do |maker|
rss.channel.setup_maker(maker)
@@ -244,7 +244,7 @@ module RSS
end
end
end
-
+
assert_equal(item_size, new_rss.items.size)
new_rss.items.each_with_index do |item, i|
assert_equal("#{link}#{i}", item.about)
@@ -255,11 +255,11 @@ module RSS
@dc_elems.each do |var, value|
assert_equal(item.__send__("dc_#{var}"), value)
end
-
+
@content_elems.each do |var, value|
assert_equal(item.__send__("content_#{var}"), value)
end
-
+
assert_equal(@trackback_elems[:ping], item.trackback_ping)
assert_equal(@trackback_elems[:about].size, item.trackback_abouts.size)
item.trackback_abouts.each_with_index do |about, j|
@@ -274,10 +274,10 @@ module RSS
description = "text hoge fuga"
item_size = 5
-
+
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
item = RSS::RDF::Item.new("#{link}#{i}")
item.title = "#{title}#{i}"
@@ -296,10 +296,10 @@ module RSS
assert_equal("#{description}#{i}", item.description)
end
-
+
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
item = RSS::RDF::Item.new("#{link}#{i}")
item.title = "#{title}#{i}"
@@ -322,11 +322,11 @@ module RSS
def test_setup_maker_items_backward_compatibility
test_setup_maker_items(true)
end
-
+
def test_setup_maker
encoding = "EUC-JP"
standalone = true
-
+
href = 'a.xsl'
type = 'text/xsl'
title = 'sample'
@@ -350,11 +350,11 @@ module RSS
setup_dummy_channel(maker)
setup_dummy_item(maker)
end
-
+
new_rss = RSS::Maker.make("1.0") do |maker|
rss.setup_maker(maker)
end
-
+
assert_equal("1.0", new_rss.rss_version)
assert_equal(encoding, new_rss.encoding)
assert_equal(standalone, new_rss.standalone)
@@ -372,7 +372,7 @@ module RSS
def test_setup_maker_full
encoding = "EUC-JP"
standalone = true
-
+
href = 'a.xsl'
type = 'text/xsl'
title = 'sample'
@@ -387,18 +387,18 @@ module RSS
image_title = "fugafuga"
image_url = "http://hoge.com/hoge.png"
-
+
textinput_title = "fugafuga"
textinput_description = "text hoge fuga"
textinput_name = "hoge"
textinput_link = "http://hoge.com"
-
+
item_title = "TITLE"
item_link = "http://hoge.com/"
item_description = "text hoge fuga"
item_size = 5
-
+
rss = RSS::Maker.make("1.0") do |maker|
maker.encoding = encoding
maker.standalone = standalone
@@ -422,13 +422,13 @@ module RSS
@sy_elems.each do |var, value|
maker.channel.__send__("sy_#{var}=", value)
end
-
+
maker.image.title = image_title
maker.image.url = image_url
@dc_elems.each do |var, value|
maker.image.__send__("dc_#{var}=", value)
end
-
+
maker.textinput.link = textinput_link
maker.textinput.title = textinput_title
maker.textinput.description = textinput_description
@@ -436,7 +436,7 @@ module RSS
@dc_elems.each do |var, value|
maker.textinput.__send__("dc_#{var}=", value)
end
-
+
item_size.times do |i|
maker.items.new_item do |item|
item.title = "#{item_title}#{i}"
@@ -462,11 +462,11 @@ module RSS
setup_taxo_topic(maker, @taxo_topic_elems)
end
-
+
new_rss = RSS::Maker.make("1.0") do |maker|
rss.setup_maker(maker)
end
-
+
assert_equal("1.0", new_rss.rss_version)
assert_equal(encoding, new_rss.encoding)
assert_equal(standalone, new_rss.standalone)
@@ -509,7 +509,7 @@ module RSS
@dc_elems.each do |var, value|
assert_equal(image.__send__("dc_#{var}"), value)
end
-
+
textinput = new_rss.textinput
assert_equal(textinput_link, textinput.about)
assert_equal(textinput_link, new_rss.channel.textinput.resource)
@@ -531,11 +531,11 @@ module RSS
@dc_elems.each do |var, value|
assert_equal(item.__send__("dc_#{var}"), value)
end
-
+
@content_elems.each do |var, value|
assert_equal(item.__send__("content_#{var}"), value)
end
-
+
assert_equal(@trackback_elems[:ping], item.trackback_ping)
assert_equal(@trackback_elems[:about].size, item.trackback_abouts.size)
item.trackback_abouts.each_with_index do |about, j|
@@ -545,6 +545,6 @@ module RSS
assert_taxo_topic(@taxo_topic_elems, new_rss)
end
-
+
end
end
diff --git a/test/rss/test_setup_maker_2.0.rb b/test/rss/test_setup_maker_2.0.rb
index 8fb727d..17a066a 100644
--- a/test/rss/test_setup_maker_2.0.rb
+++ b/test/rss/test_setup_maker_2.0.rb
@@ -62,7 +62,7 @@ module RSS
new_category.content = category
end
end
-
+
maker.channel.generator = generator
maker.channel.ttl = ttl
end
@@ -71,7 +71,7 @@ module RSS
rss.channel.setup_maker(maker)
end
channel = new_rss.channel
-
+
assert_equal(title, channel.title)
assert_equal(link, channel.link)
assert_equal(description, channel.description)
@@ -90,12 +90,12 @@ module RSS
skipHours.each_with_index do |hour, i|
assert_equal(hour.to_i, channel.skipHours.hours[i].content)
end
-
+
channel.categories.each_with_index do |category, i|
assert_equal(categories[i], category.content)
end
-
+
assert_equal(generator, channel.generator)
assert_equal(ttl.to_i, channel.ttl)
@@ -116,19 +116,19 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
maker.image.height = height
maker.image.description = description
end
-
+
new_rss = RSS::Maker.make("2.0") do |maker|
rss.channel.setup_maker(maker)
rss.image.setup_maker(maker)
end
-
+
image = new_rss.image
assert_equal(title, image.title)
assert_equal(link, image.link)
@@ -137,7 +137,7 @@ module RSS
assert_equal(height.to_i, image.height)
assert_equal(description, image.description)
end
-
+
def test_setup_maker_textinput
title = "fugafuga"
description = "text hoge fuga"
@@ -157,7 +157,7 @@ module RSS
rss.channel.setup_maker(maker)
rss.textinput.setup_maker(maker)
end
-
+
textInput = new_rss.channel.textInput
assert_equal(title, textInput.title)
assert_equal(description, textInput.description)
@@ -175,22 +175,22 @@ module RSS
guid_isPermaLink = "true"
guid_content = "http://inessential.com/2002/09/01.php#a2"
-
+
enclosure_url = "http://www.scripting.com/mp3s/weatherReportSuite.mp3"
enclosure_length = "12216320"
enclosure_type = "audio/mpeg"
source_url = "http://static.userland.com/tomalak/links2.xml"
source_content = "Tomalak's Realm"
-
+
category_domain = "http://www.fool.com/cusips"
category_content = "MSFT"
-
+
item_size = 5
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |item|
item.title = "#{title}#{i}"
@@ -216,7 +216,7 @@ module RSS
end
end
end
-
+
new_rss = RSS::Maker.make("2.0") do |maker|
rss.channel.setup_maker(maker)
@@ -228,7 +228,7 @@ module RSS
end
end
end
-
+
assert_equal(item_size, new_rss.items.size)
new_rss.items.each_with_index do |item, i|
assert_equal("#{title}#{i}", item.title)
@@ -258,11 +258,11 @@ module RSS
def test_setup_maker_items_backward_compatibility
test_setup_maker_items(true)
end
-
+
def test_setup_maker
encoding = "EUC-JP"
standalone = true
-
+
href = 'a.xsl'
type = 'text/xsl'
title = 'sample'
@@ -285,11 +285,11 @@ module RSS
setup_dummy_channel(maker)
end
-
+
new_rss = RSS::Maker.make("2.0") do |maker|
rss.setup_maker(maker)
end
-
+
assert_equal("2.0", new_rss.rss_version)
assert_equal(encoding, new_rss.encoding)
assert_equal(standalone, new_rss.standalone)
@@ -303,6 +303,6 @@ module RSS
assert_equal(charset, xss.charset)
assert_equal(alternate, xss.alternate)
end
-
+
end
end
diff --git a/test/rss/test_setup_maker_atom_feed.rb b/test/rss/test_setup_maker_atom_feed.rb
index 03d33db..978b3cf 100644
--- a/test/rss/test_setup_maker_atom_feed.rb
+++ b/test/rss/test_setup_maker_atom_feed.rb
@@ -299,7 +299,7 @@ module RSS
def test_setup_maker
encoding = "EUC-JP"
standalone = true
-
+
href = 'a.xsl'
type = 'text/xsl'
title = 'sample'
diff --git a/test/rss/test_syndication.rb b/test/rss/test_syndication.rb
index abd75e9..69d6f44 100644
--- a/test/rss/test_syndication.rb
+++ b/test/rss/test_syndication.rb
@@ -8,28 +8,28 @@ require "rss/syndication"
module RSS
class TestSyndication < TestCase
-
+
def setup
@prefix = "sy"
@uri = "http://purl.org/rss/1.0/modules/syndication/"
-
+
@parents = %w(channel)
-
+
t = Time.iso8601("2000-01-01T12:00:05+00:00")
class << t
alias_method(:to_s, :iso8601)
end
-
+
@elems = {
:updatePeriod => "hourly",
:updateFrequency => "2",
:updateBase => t,
}
-
+
@sy_nodes = @elems.collect do |name, value|
"<#{@prefix}:#{name}>#{CGI.escapeHTML(value.to_s)}</#{@prefix}:#{name}>"
end.join("\n")
-
+
@rss_source = make_RDF(<<-EOR, {@prefix => @uri})
#{make_channel(@sy_nodes)}
#{make_image()}
@@ -39,13 +39,13 @@ EOR
@rss = Parser.parse(@rss_source)
end
-
+
def test_parser
-
+
assert_nothing_raised do
Parser.parse(@rss_source)
end
-
+
@elems.each do |tag, value|
assert_too_much_tag(tag.to_s, "channel") do
Parser.parse(make_RDF(<<-EOR, {@prefix => @uri}))
@@ -58,20 +58,20 @@ EOR
end
end
-
+
def test_accessor
-
+
t = Time.iso8601("2003-01-01T12:00:23+09:00")
class << t
alias_method(:to_s, :iso8601)
end
-
+
new_value = {
:updatePeriod => "daily",
:updateFrequency => "11",
:updateBase => t,
}
-
+
@elems.each do |name, value|
value = value.to_i if name == :updateFrequency
@parents.each do |parent|
@@ -82,7 +82,7 @@ EOR
assert_equal(new_val, @rss.__send__(parent).__send__("sy_#{name}"))
end
end
-
+
%w(hourly daily weekly monthly yearly).each do |x|
@parents.each do |parent|
assert_nothing_raised do
@@ -90,7 +90,7 @@ EOR
end
end
end
-
+
%w(-2 0.3 -0.4).each do |x|
@parents.each do |parent|
assert_not_available_value("sy:updateBase", x) do
@@ -98,11 +98,11 @@ EOR
end
end
end
-
+
end
def test_to_s
-
+
@elems.each do |name, value|
excepted = "<#{@prefix}:#{name}>#{value}</#{@prefix}:#{name}>"
@parents.each do |parent|
@@ -110,7 +110,7 @@ EOR
@rss.__send__(parent).__send__("sy_#{name}_element"))
end
end
-
+
REXML::Document.new(@rss_source).root.each_element do |parent|
if @parents.include?(parent.name)
parent.each_element do |elem|
diff --git a/test/rss/test_taxonomy.rb b/test/rss/test_taxonomy.rb
index 5109f3d..0370555 100644
--- a/test/rss/test_taxonomy.rb
+++ b/test/rss/test_taxonomy.rb
@@ -8,7 +8,7 @@ require "rss/taxonomy"
module RSS
class TestTaxonomy < TestCase
-
+
def setup
@prefix = "taxo"
@uri = "http://purl.org/rss/1.0/modules/taxonomy/"
@@ -19,9 +19,9 @@ module RSS
@prefix => @uri,
@dc_prefix => @dc_uri,
}
-
+
@topics_parents = %w(channel item)
-
+
@topics_lis = [
"http://meerkat.oreillynet.com/?c=cat23",
"http://meerkat.oreillynet.com/?c=47",
@@ -81,7 +81,7 @@ module RSS
end
rv << "</#{@prefix}:topic>"
end
-
+
@rss_source = make_RDF(<<-EOR, @ns)
#{make_channel(@topics_node)}
#{make_image()}
@@ -97,7 +97,7 @@ EOR
assert_nothing_raised do
Parser.parse(@rss_source)
end
-
+
assert_too_much_tag("topics", "channel") do
Parser.parse(make_RDF(<<-EOR, @ns))
#{make_channel(@topics_node * 2)}
@@ -112,7 +112,7 @@ EOR
EOR
end
end
-
+
def test_accessor
topics = @rss.channel.taxo_topics
assert_equal(@topics_lis.sort,
@@ -136,7 +136,7 @@ EOR
end
end
end
-
+
def test_to_s
@topics_parents.each do |parent|
meth = "taxo_topics_element"
diff --git a/test/rss/test_to_s.rb b/test/rss/test_to_s.rb
index 6673959..4b38737 100644
--- a/test/rss/test_to_s.rb
+++ b/test/rss/test_to_s.rb
@@ -19,7 +19,7 @@ module RSS
"http://example.com/1",
"http://example.com/2",
]
-
+
setup_xml_declaration_info
setup_xml_stylesheet_infos
setup_channel_info
@@ -57,7 +57,7 @@ module RSS
assert_image10(@image_info, rss.image)
assert_textinput10(@textinput_info, rss.textinput)
end
-
+
def test_to_s_09
rss = RSS::Maker.make("0.91") do |maker|
setup_full(maker)
@@ -79,7 +79,7 @@ module RSS
assert_image09(@image_info, rss.image)
assert_textinput09(@textinput_info, rss.textinput)
end
-
+
def test_to_s_20
rss = RSS::Maker.make("2.0") do |maker|
setup_full(maker)
@@ -101,7 +101,7 @@ module RSS
assert_image20(@image_info, rss.image)
assert_textinput20(@textinput_info, rss.textinput)
end
-
+
private
def setup_xml_declaration_info
@version = "1.0"
@@ -278,13 +278,13 @@ module RSS
"updateBase" => Time.now - 3600,
}
end
-
+
def setup_content_info
@content_info = {
"encoded" => "<p>p</p>",
}
end
-
+
def setup_trackback_info
@trackback_info = {
"ping" => "http://example.com/tb.cgi?tb_id=XXX",
@@ -323,7 +323,7 @@ module RSS
def setup_channel(maker)
channel = maker.channel
info = @channel_info
-
+
%w(about title link description language copyright
managingEditor webMaster rating docs date
lastBuildDate generator ttl).each do |name|
@@ -341,7 +341,7 @@ module RSS
new_hour = skipHours.new_hour
new_hour.content = hour
end
-
+
cloud = channel.cloud
%w(domain port path registerProcedure protocol).each do |name|
cloud.__send__("#{name}=", info["cloud"][name])
@@ -352,7 +352,7 @@ module RSS
category.__send__("#{name}=", info["category"][name])
end
end
-
+
def setup_image(maker)
image = maker.image
info = @image_info
@@ -361,7 +361,7 @@ module RSS
image.__send__("#{name}=", info[name])
end
end
-
+
def setup_items(maker)
items = maker.items
@@ -370,7 +370,7 @@ module RSS
%w(title link description date author comments).each do |name|
item.__send__("#{name}=", info[name])
end
-
+
guid = item.guid
%w(isPermaLink content).each do |name|
guid.__send__("#{name}=", info["guid"][name])
@@ -410,7 +410,7 @@ module RSS
target.__send__("#{prefix}_#{name}=", @content_info[name])
end
end
-
+
def setup_dublin_core(target)
prefix = "dc"
%w(title description creator subject publisher
@@ -419,14 +419,14 @@ module RSS
target.__send__("#{prefix}_#{name}=", @dc_info[name])
end
end
-
+
def setup_syndicate(target)
prefix = "sy"
%w(updatePeriod updateFrequency updateBase).each do |name|
target.__send__("#{prefix}_#{name}=", @sy_info[name])
end
end
-
+
def setup_trackback(target)
target.trackback_ping = @trackback_info["ping"]
@trackback_info["abouts"].each do |about|
@@ -439,7 +439,7 @@ module RSS
def assert_channel10(attrs, channel)
_wrap_assertion do
n_attrs = normalized_attrs(attrs)
-
+
names = %w(about title link description)
assert_attributes(attrs, names, channel)
@@ -458,7 +458,7 @@ module RSS
assert_attributes(attrs, %w(resource), image)
end
end
-
+
def assert_channel10_textinput(attrs, textinput)
_wrap_assertion do
assert_attributes(attrs, %w(resource), textinput)
@@ -506,7 +506,7 @@ module RSS
copyright pubDate lastBuildDate docs
managingEditor webMaster)
assert_attributes(attrs, names, channel)
-
+
%w(skipHours skipDays).each do |name|
value = n_attrs[name]
if value
@@ -525,7 +525,7 @@ module RSS
end
end
end
-
+
def assert_channel09_skipHours(contents, skipHours)
_wrap_assertion do
hours = skipHours.hours
@@ -534,7 +534,7 @@ module RSS
end
end
end
-
+
def assert_image09(attrs, image)
_wrap_assertion do
names = %w(url link title description)
@@ -552,7 +552,7 @@ module RSS
end
end
end
-
+
def assert_textinput09(attrs, textinput)
_wrap_assertion do
names = %w(title description name link)
@@ -564,7 +564,7 @@ module RSS
def assert_channel20(attrs, channel)
_wrap_assertion do
n_attrs = normalized_attrs(attrs)
-
+
names = %w(title link description language copyright
managingEditor webMaster pubDate
lastBuildDate generator docs rating)
@@ -584,11 +584,11 @@ module RSS
def assert_channel20_skipDays(contents, skipDays)
assert_channel09_skipDays(contents, skipDays)
end
-
+
def assert_channel20_skipHours(contents, skipHours)
assert_channel09_skipHours(contents, skipHours)
end
-
+
def assert_channel20_cloud(attrs, cloud)
_wrap_assertion do
names = %w(domain path registerProcedure protocol)
@@ -596,7 +596,7 @@ module RSS
assert_attributes(attrs, names, cloud)
end
end
-
+
def assert_channel20_categories(attrs, categories)
_wrap_assertion do
names = %w(domain content)
@@ -605,7 +605,7 @@ module RSS
end
end
end
-
+
def assert_image20(attrs, image)
_wrap_assertion do
names = %w(url link title description)
@@ -639,20 +639,20 @@ module RSS
assert_attributes(attrs, %w(url content), source)
end
end
-
+
def assert_items20_enclosure(attrs, enclosure)
_wrap_assertion do
names = ["url", ["length", :integer], "type"]
assert_attributes(attrs, names, enclosure)
end
end
-
+
def assert_items20_categories(attrs, categories)
_wrap_assertion do
assert_channel20_categories(attrs, categories)
end
end
-
+
def assert_items20_guid(attrs, guid)
_wrap_assertion do
names = [["isPermaLink", :boolean], ["content"]]
diff --git a/test/rss/test_trackback.rb b/test/rss/test_trackback.rb
index 26812d9..433e884 100644
--- a/test/rss/test_trackback.rb
+++ b/test/rss/test_trackback.rb
@@ -9,26 +9,26 @@ require "rss/trackback"
module RSS
class TestTrackBack < TestCase
-
+
def setup
@prefix = "trackback"
@uri = "http://madskills.com/public/xml/rss/module/trackback/"
-
+
@parents = %w(item)
-
+
@elems = {
:ping => "http://bar.com/tb.cgi?tb_id=rssplustrackback",
:about => "http://foo.com/trackback/tb.cgi?tb_id=20020923",
}
-
+
@content_nodes = @elems.collect do |name, value|
"<#{@prefix}:#{name} rdf:resource=\"#{CGI.escapeHTML(value.to_s)}\"/>"
end.join("\n")
-
+
@content_nodes2 = @elems.collect do |name, value|
"<#{@prefix}:#{name}>#{CGI.escapeHTML(value.to_s)}</#{@prefix}:#{name}>"
end.join("\n")
-
+
@rss_source = make_RDF(<<-EOR, {@prefix => @uri})
#{make_channel()}
#{make_image()}
@@ -77,14 +77,14 @@ EOR
end
end
-
+
def test_accessor
-
+
new_value = {
:ping => "http://baz.com/trackback/tb.cgi?tb_id=20030808",
:about => "http://hoge.com/trackback/tb.cgi?tb_id=90030808",
}
-
+
@elems.each do |name, value|
@parents.each do |parent|
accessor = "#{RSS::TRACKBACK_PREFIX}_#{name}"
@@ -104,11 +104,11 @@ EOR
assert_equal(new_value[name], target20.__send__(accessor))
end
end
-
+
end
def test_to_s
-
+
@elems.each do |name, value|
excepted = %Q!<#{@prefix}:#{name} rdf:resource="#{CGI.escapeHTML(value)}"/>!
@parents.each do |parent|
@@ -117,7 +117,7 @@ EOR
assert_equal(excepted, @rss.__send__(parent).__send__(meth))
end
end
-
+
REXML::Document.new(@rss_source).root.each_element do |parent|
if @parents.include?(parent.name)
parent.each_element do |elem|
@@ -127,9 +127,9 @@ EOR
end
end
end
-
+
end
-
+
end
end
diff --git a/test/rss/test_xml-stylesheet.rb b/test/rss/test_xml-stylesheet.rb
index b946af1..cc19a38 100644
--- a/test/rss/test_xml-stylesheet.rb
+++ b/test/rss/test_xml-stylesheet.rb
@@ -7,7 +7,7 @@ require "rss/xml-stylesheet"
module RSS
class TestXMLStyleSheet < TestCase
-
+
def test_accessor
[
{:href => "a.xsl", :type => "text/xsl"},
@@ -17,7 +17,7 @@ module RSS
assert_xml_stylesheet_attrs(attrs, XMLStyleSheet.new(attrs))
end
end
-
+
def test_to_s
[
{:href => "a.xsl", :type => "text/xsl"},
@@ -39,7 +39,7 @@ module RSS
assert_xml_stylesheet(target, attrs, XMLStyleSheet.new(contents))
end
end
-
+
def test_bad_alternate
%w(a ___ ??? BAD_ALTERNATE).each do |value|
xss = XMLStyleSheet.new
@@ -53,7 +53,7 @@ module RSS
assert_nil(xss.alternate)
end
end
-
+
def test_parse
[
[{:href => "a.xsl", :type => "text/xsl"},],
@@ -92,7 +92,7 @@ module RSS
end
end
end
-
+
def parse_pi(pi)
/\A\s*<\?(\S+)([^(?:\?>)]+)\?>\s*\z/ =~ pi
target = $1
@@ -103,6 +103,6 @@ module RSS
end
[target, contents]
end
-
+
end
end