ruby-changes:12905
From: kou <ko1@a...>
Date: Mon, 24 Aug 2009 21:32:40 +0900 (JST)
Subject: [ruby-changes:12905] Ruby:r24640 (ruby_1_8): * lib/rss/maker/base.rb, test/rss/test_maker_2.0.rb: fix a bug
kou 2009-08-24 21:32:24 +0900 (Mon, 24 Aug 2009) New Revision: 24640 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24640 Log: * lib/rss/maker/base.rb, test/rss/test_maker_2.0.rb: fix a bug that RSS Maker doesn't accept 'false' as guid's isPermaLink. Reported by Joe Holt. Thanks!!! Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/lib/rss/maker/base.rb branches/ruby_1_8/test/rss/test_maker_2.0.rb Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 24639) +++ ruby_1_8/ChangeLog (revision 24640) @@ -1,3 +1,9 @@ +Mon Aug 24 21:33:34 2009 Kouhei Sutou <kou@c...> + + * lib/rss/maker/base.rb, test/rss/test_maker_2.0.rb: fix a bug + that RSS Maker doesn't accept 'false' as guid's isPermaLink. + Reported by Joe Holt. Thanks!!! + Sat Aug 22 12:08:42 2009 Nobuyoshi Nakada <nobu@r...> * lib/test/unit.rb (Test::Unit.run=, Test::Unit.run?): fixed rdoc. Index: ruby_1_8/lib/rss/maker/base.rb =================================================================== --- ruby_1_8/lib/rss/maker/base.rb (revision 24639) +++ ruby_1_8/lib/rss/maker/base.rb (revision 24640) @@ -238,7 +238,7 @@ setter = "#{var}=" if target.respond_to?(setter) value = __send__(var) - if value + unless value.nil? target.__send__(setter, value) set = true end Index: ruby_1_8/test/rss/test_maker_2.0.rb =================================================================== --- ruby_1_8/test/rss/test_maker_2.0.rb (revision 24639) +++ ruby_1_8/test/rss/test_maker_2.0.rb (revision 24640) @@ -508,6 +508,26 @@ assert_equal(content, guid.content) end + def test_guid_permanent_link_false + 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) + + guid = maker.items.last.guid + assert_equal(nil, guid.permanent_link?) + assert_equal(guid.isPermaLink, guid.permanent_link?) + guid.permanent_link = false + assert_equal(false, guid.permanent_link?) + assert_equal(guid.isPermaLink, guid.permanent_link?) + guid.content = content + end + guid = rss.channel.items.last.guid + assert_equal(false, guid.isPermaLink) + assert_equal(content, guid.content) + end + def test_not_valid_guid content = "http://inessential.com/2002/09/01.php#a2" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/