ruby-changes:12904
From: kou <ko1@a...>
Date: Mon, 24 Aug 2009 21:31:49 +0900 (JST)
Subject: [ruby-changes:12904] Ruby:r24639 (trunk): * lib/rss/maker/base.rb, test/rss/test_maker_2.0.rb: fix a bug
kou 2009-08-24 21:31:22 +0900 (Mon, 24 Aug 2009) New Revision: 24639 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24639 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: trunk/ChangeLog trunk/lib/rss/maker/base.rb trunk/test/rss/test_maker_2.0.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 24638) +++ ChangeLog (revision 24639) @@ -1,3 +1,9 @@ +Mon Aug 24 21:31:37 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!!! + Mon Aug 24 18:58:56 2009 NAKAMURA Usaku <usa@r...> * include/ruby/missing.h (vsnprintf): rollback a part of r24179, because Index: lib/rss/maker/base.rb =================================================================== --- lib/rss/maker/base.rb (revision 24638) +++ lib/rss/maker/base.rb (revision 24639) @@ -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: test/rss/test_maker_2.0.rb =================================================================== --- test/rss/test_maker_2.0.rb (revision 24638) +++ test/rss/test_maker_2.0.rb (revision 24639) @@ -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/