1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rss/rss.rb (RSS::VERSION): 0.1.4 -> 0.1.5.

* test/rss/test_version.rb (RSS::TestVersion#test_version):
  ditto.

* lib/rss/0.9.rb (RSS::Rss::Channel::Item::Category):
  domain attribute of <category> is optional. Thanks to
  Chris Lee <clee@kde.org>.

* test/rss/test_parser.rb (RSS::TestParser#test_category20):
  adjusted test case.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kou 2005-07-08 06:51:21 +00:00
parent b402bdf203
commit cff37c6dcc
5 changed files with 30 additions and 28 deletions

View file

@ -1,3 +1,17 @@
Fri Jul 8 15:45:04 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/rss.rb (RSS::VERSION): 0.1.4 -> 0.1.5.
* test/rss/test_version.rb (RSS::TestVersion#test_version):
ditto.
* lib/rss/0.9.rb (RSS::Rss::Channel::Item::Category):
domain attribute of <category> is optional. Thanks to
Chris Lee <clee@kde.org>.
* test/rss/test_parser.rb (RSS::TestParser#test_category20):
adjusted test case.
Wed Jul 6 18:45:53 2005 Yukihiro Matsumoto <matz@ruby-lang.org> Wed Jul 6 18:45:53 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* object.c (rb_obj_pattern_match): now returns nil. * object.c (rb_obj_pattern_match): now returns nil.

View file

@ -572,7 +572,7 @@ module RSS
include RSS09 include RSS09
[ [
["domain", nil, true] ["domain", nil, false]
].each do |name, uri, required| ].each do |name, uri, required|
install_get_attribute(name, uri, required) install_get_attribute(name, uri, required)
end end
@ -588,7 +588,7 @@ module RSS
private private
def _attrs def _attrs
[ [
["domain", true] ["domain", false]
] ]
end end

View file

@ -66,7 +66,7 @@ require "rss/xml-stylesheet"
module RSS module RSS
VERSION = "0.1.4" VERSION = "0.1.5"
URI = "http://purl.org/rss/1.0/" URI = "http://purl.org/rss/1.0/"

View file

@ -544,40 +544,28 @@ EOR
end end
def test_category20 def test_category20
values = [nil, CATEGORY_DOMAIN]
attrs = [
["domain", CATEGORY_DOMAIN],
]
(attrs.size + 1).times do |i| values.each do |value|
missing_attr = attrs[i] domain = ""
if missing_attr domain << %Q[domain="#{value}"] if value
meth = :missing_attribute
args = ["category", missing_attr[0]]
else
meth = :nothing_raised
args = []
end
category_attrs = []
attrs.each_with_index do |attr, j|
unless i == j
category_attrs << %Q[#{attr[0]}="#{attr[1]}"]
end
end
["", "Example Text"].each do |text| ["", "Example Text"].each do |text|
assert_parse(make_rss20(<<-EOR), meth, *args) rss_src = make_rss20(<<-EOR)
#{make_channel20(%Q[ #{make_channel20(%Q[
#{make_item20(%Q[ #{make_item20(%Q[
<category <category #{domain}>#{text}</category>
#{category_attrs.join("\n")}>#{text}</category>
])} ])}
])} ])}
EOR EOR
assert_parse(rss_src, :nothing_raised)
rss = RSS::Parser.parse(rss_src)
category = rss.items.last.categories.first
assert_equal(value, category.domain)
assert_equal(text, category.content)
end end
end end
end end
def test_ignore def test_ignore

View file

@ -3,7 +3,7 @@ require "rss-testcase"
module RSS module RSS
class TestVersion < TestCase class TestVersion < TestCase
def test_version def test_version
assert_equal("0.1.4", ::RSS::VERSION) assert_equal("0.1.5", ::RSS::VERSION)
end end
end end
end end