mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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!!! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9096abd36a
commit
b0947c5e04
3 changed files with 27 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Mon Aug 24 21:31:37 2009 Kouhei Sutou <kou@cozmixng.org>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Mon Aug 24 18:58:56 2009 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* include/ruby/missing.h (vsnprintf): rollback a part of r24179, because
|
* include/ruby/missing.h (vsnprintf): rollback a part of r24179, because
|
||||||
|
|
|
@ -238,7 +238,7 @@ module RSS
|
||||||
setter = "#{var}="
|
setter = "#{var}="
|
||||||
if target.respond_to?(setter)
|
if target.respond_to?(setter)
|
||||||
value = __send__(var)
|
value = __send__(var)
|
||||||
if value
|
unless value.nil?
|
||||||
target.__send__(setter, value)
|
target.__send__(setter, value)
|
||||||
set = true
|
set = true
|
||||||
end
|
end
|
||||||
|
|
|
@ -508,6 +508,26 @@ module RSS
|
||||||
assert_equal(content, guid.content)
|
assert_equal(content, guid.content)
|
||||||
end
|
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
|
def test_not_valid_guid
|
||||||
content = "http://inessential.com/2002/09/01.php#a2"
|
content = "http://inessential.com/2002/09/01.php#a2"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue