summaryrefslogtreecommitdiff
path: root/test/rss
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-03 06:43:18 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-03 06:43:18 +0000
commitd5b6a7b16947aaf4821d6b76c7de153866fb30c0 (patch)
tree450b783d2d0ee2af19ba3efb8324e73a5e0fc1d5 /test/rss
parent0b4597eccfb5ee078e546c910f2f3cee31d3274b (diff)
* test/rss/*.rb: removed tab width configuration headers.
* test/rss/test_maker_{0.9,1.0}.rb: sort -> do_sort. * lib/rss/maker/*.rb: changed API to RSS version independence. * lib/rss/maker/base.rb (RSS::Maker::XMLStyleSheets::XMLStyleSheet): checked required (pseudo) attributes. * lib/rss/maker/base.rb (RSS::Maker::Items): sort -> do_sort. * lib/rss/rss.rb (RSS::BaseModel.install_date_element): avoided warning. * lib/rss/0.9.rb (RSS::Rss#textinput): added convenience method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rss')
-rw-r--r--test/rss/test_1.0.rb2
-rw-r--r--test/rss/test_accessor.rb2
-rw-r--r--test/rss/test_content.rb2
-rw-r--r--test/rss/test_dublincore.rb2
-rw-r--r--test/rss/test_maker_0.9.rb4
-rw-r--r--test/rss/test_maker_1.0.rb4
-rw-r--r--test/rss/test_maker_2.0.rb3
-rw-r--r--test/rss/test_maker_xml-stylesheet.rb25
-rw-r--r--test/rss/test_parser.rb2
-rw-r--r--test/rss/test_syndication.rb2
-rw-r--r--test/rss/test_trackback.rb2
-rw-r--r--test/rss/test_xml-stylesheet.rb2
12 files changed, 30 insertions, 22 deletions
diff --git a/test/rss/test_1.0.rb b/test/rss/test_1.0.rb
index 43a168d035a..e6a81af2bd5 100644
--- a/test/rss/test_1.0.rb
+++ b/test/rss/test_1.0.rb
@@ -1,5 +1,3 @@
-# -*- tab-width: 2 -*- vim: ts=2
-
require "rexml/document"
require "rss-testcase"
diff --git a/test/rss/test_accessor.rb b/test/rss/test_accessor.rb
index 1b92f9d98c8..5281a81c2ce 100644
--- a/test/rss/test_accessor.rb
+++ b/test/rss/test_accessor.rb
@@ -1,5 +1,3 @@
-# -*- tab-width: 2 -*- vim: ts=2
-
require "rss-testcase"
require "rss/1.0"
diff --git a/test/rss/test_content.rb b/test/rss/test_content.rb
index c0f6e4292f1..77cd1c7005d 100644
--- a/test/rss/test_content.rb
+++ b/test/rss/test_content.rb
@@ -1,5 +1,3 @@
-# -*- tab-width: 2 -*- vim: ts=2
-
require "cgi"
require "rexml/document"
diff --git a/test/rss/test_dublincore.rb b/test/rss/test_dublincore.rb
index 796666cdb57..d95d31f24e5 100644
--- a/test/rss/test_dublincore.rb
+++ b/test/rss/test_dublincore.rb
@@ -1,5 +1,3 @@
-# -*- tab-width: 2 -*- vim: ts=2
-
require "cgi"
require "rexml/document"
diff --git a/test/rss/test_maker_0.9.rb b/test/rss/test_maker_0.9.rb
index 4ccae45405d..df8cd5fe119 100644
--- a/test/rss/test_maker_0.9.rb
+++ b/test/rss/test_maker_0.9.rb
@@ -279,7 +279,7 @@ module RSS
item.link = "#{link}#{i}"
item.description = "#{description}#{i}"
end
- maker.items.sort
+ maker.items.do_sort = true
end
assert_equal(item_size, rss.items.size)
rss.channel.items.each_with_index do |item, i|
@@ -298,7 +298,7 @@ module RSS
item.link = "#{link}#{i}"
item.description = "#{description}#{i}"
end
- maker.items.sort = Proc.new do |x, y|
+ maker.items.do_sort = Proc.new do |x, y|
y.title[-1] <=> x.title[-1]
end
end
diff --git a/test/rss/test_maker_1.0.rb b/test/rss/test_maker_1.0.rb
index 91ba29d7116..8f80f6e2fe9 100644
--- a/test/rss/test_maker_1.0.rb
+++ b/test/rss/test_maker_1.0.rb
@@ -220,7 +220,7 @@ module RSS
item.link = "#{link}#{i}"
item.description = "#{description}#{i}"
end
- maker.items.sort = true
+ maker.items.do_sort = true
end
assert_equal(item_size, rss.items.size)
rss.items.each_with_index do |item, i|
@@ -239,7 +239,7 @@ module RSS
item.link = "#{link}#{i}"
item.description = "#{description}#{i}"
end
- maker.items.sort = Proc.new do |x, y|
+ maker.items.do_sort = Proc.new do |x, y|
y.title[-1] <=> x.title[-1]
end
end
diff --git a/test/rss/test_maker_2.0.rb b/test/rss/test_maker_2.0.rb
index 54375934c41..b0752f985f3 100644
--- a/test/rss/test_maker_2.0.rb
+++ b/test/rss/test_maker_2.0.rb
@@ -340,6 +340,7 @@ module RSS
item.comments = "#{comments}#{i}"
item.date = pubDate
end
+ maker.items.do_sort = true
end
assert_equal(item_size, rss.items.size)
rss.channel.items.each_with_index do |item, i|
@@ -363,7 +364,7 @@ module RSS
item.comments = "#{comments}#{i}"
item.date = pubDate
end
- maker.items.sort = Proc.new do |x, y|
+ maker.items.do_sort = Proc.new do |x, y|
y.title[-1] <=> x.title[-1]
end
end
diff --git a/test/rss/test_maker_xml-stylesheet.rb b/test/rss/test_maker_xml-stylesheet.rb
index b959073554e..bbdfdc682bc 100644
--- a/test/rss/test_maker_xml-stylesheet.rb
+++ b/test/rss/test_maker_xml-stylesheet.rb
@@ -5,7 +5,7 @@ require "rss/maker"
module RSS
class TestMakerXMLStyleSheet < TestCase
- def test_rss10
+ def test_xml_stylesheet
href = 'a.xsl'
type = 'text/xsl'
title = 'sample'
@@ -47,6 +47,29 @@ module RSS
assert_equal(href, xss.href)
assert_equal(type, xss.type)
end
+
+ def test_not_valid_xml_stylesheet
+ href = 'xss.XXX'
+ type = "text/xsl"
+
+ rss = RSS::Maker.make("1.0") do |maker|
+ xss = maker.xml_stylesheets.new_xml_stylesheet
+ # xss.href = href
+ xss.type = type
+
+ setup_dummy_channel(maker)
+ end
+ assert(rss.xml_stylesheets.empty?)
+
+ rss = RSS::Maker.make("1.0") do |maker|
+ xss = maker.xml_stylesheets.new_xml_stylesheet
+ xss.href = href
+ # xss.type = type
+
+ setup_dummy_channel(maker)
+ end
+ assert(rss.xml_stylesheets.empty?)
+ end
end
end
diff --git a/test/rss/test_parser.rb b/test/rss/test_parser.rb
index 3fd26bffb4b..de4894997f0 100644
--- a/test/rss/test_parser.rb
+++ b/test/rss/test_parser.rb
@@ -1,5 +1,3 @@
-# -*- tab-width: 2 -*- vim: ts=2
-
require "rss-testcase"
require "rss/1.0"
diff --git a/test/rss/test_syndication.rb b/test/rss/test_syndication.rb
index 9d620089e12..a3dd763c837 100644
--- a/test/rss/test_syndication.rb
+++ b/test/rss/test_syndication.rb
@@ -1,5 +1,3 @@
-# -*- tab-width: 2 -*- vim: ts=2
-
require "cgi"
require "rexml/document"
diff --git a/test/rss/test_trackback.rb b/test/rss/test_trackback.rb
index 9c4b086caec..bfe39d005b5 100644
--- a/test/rss/test_trackback.rb
+++ b/test/rss/test_trackback.rb
@@ -1,5 +1,3 @@
-# -*- tab-width: 2 -*- vim: ts=2
-
require "cgi"
require "rexml/document"
diff --git a/test/rss/test_xml-stylesheet.rb b/test/rss/test_xml-stylesheet.rb
index f3dee2c63bb..ab16d6e2ff3 100644
--- a/test/rss/test_xml-stylesheet.rb
+++ b/test/rss/test_xml-stylesheet.rb
@@ -1,5 +1,3 @@
-# -*- tab-width: 2 -*- vim: ts=2
-
require "rexml/document"
require "rss-testcase"