From 652b68a1867b7a5a6cfdda6b2292bd59df16d52d Mon Sep 17 00:00:00 2001 From: kou Date: Fri, 8 Jul 2005 06:51:21 +0000 Subject: * 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 is optional. Thanks to Chris Lee . * test/rss/test_parser.rb (RSS::TestParser#test_category20): adjusted test case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 14 ++++++++++++++ lib/rss/0.9.rb | 4 ++-- lib/rss/rss.rb | 2 +- test/rss/test_parser.rb | 36 ++++++++++++------------------------ test/rss/test_version.rb | 2 +- 5 files changed, 30 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca4bd6f6cd..837c9fbe67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +Fri Jul 8 15:45:04 2005 Kouhei Sutou + + * 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 is optional. Thanks to + Chris Lee . + + * test/rss/test_parser.rb (RSS::TestParser#test_category20): + adjusted test case. + Tue Jul 5 23:44:06 2005 Nobuyoshi Nakada * instruby.rb: expand source library path. diff --git a/lib/rss/0.9.rb b/lib/rss/0.9.rb index a473322612..3bbf67be05 100644 --- a/lib/rss/0.9.rb +++ b/lib/rss/0.9.rb @@ -572,7 +572,7 @@ module RSS include RSS09 [ - ["domain", nil, true] + ["domain", nil, false] ].each do |name, uri, required| install_get_attribute(name, uri, required) end @@ -588,7 +588,7 @@ module RSS private def _attrs [ - ["domain", true] + ["domain", false] ] end diff --git a/lib/rss/rss.rb b/lib/rss/rss.rb index 9ad4f4aeb6..e5f116ef48 100644 --- a/lib/rss/rss.rb +++ b/lib/rss/rss.rb @@ -66,7 +66,7 @@ require "rss/xml-stylesheet" module RSS - VERSION = "0.1.4" + VERSION = "0.1.5" URI = "http://purl.org/rss/1.0/" diff --git a/test/rss/test_parser.rb b/test/rss/test_parser.rb index 019030bcce..6739a11fbe 100644 --- a/test/rss/test_parser.rb +++ b/test/rss/test_parser.rb @@ -544,40 +544,28 @@ EOR end def test_category20 - - attrs = [ - ["domain", CATEGORY_DOMAIN], - ] + values = [nil, CATEGORY_DOMAIN] - (attrs.size + 1).times do |i| - missing_attr = attrs[i] - if missing_attr - 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 + values.each do |value| + domain = "" + domain << %Q[domain="#{value}"] if value ["", "Example Text"].each do |text| - assert_parse(make_rss20(<<-EOR), meth, *args) + rss_src = make_rss20(<<-EOR) #{make_channel20(%Q[ #{make_item20(%Q[ -#{text} +#{text} ])} ])} 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 def test_ignore diff --git a/test/rss/test_version.rb b/test/rss/test_version.rb index c4e83ac30d..dbed60b4d8 100644 --- a/test/rss/test_version.rb +++ b/test/rss/test_version.rb @@ -3,7 +3,7 @@ require "rss-testcase" module RSS class TestVersion < TestCase def test_version - assert_equal("0.1.4", ::RSS::VERSION) + assert_equal("0.1.5", ::RSS::VERSION) end end end -- cgit v1.2.3