diff --git a/ChangeLog b/ChangeLog index 68e1bab457..2c2d5dab76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Dec 7 21:06:38 2010 Kouhei Sutou + + * lib/rexml/doctype.rb, test/rexml/test_doctype.rb: suppress warnings. + [ruby-core:33305] + Reported by Aaron Patterson. Thanks!!! + Tue Dec 7 18:56:52 2010 NARUSE, Yui * ext/nkf/lib/kconv.rb (String#kconv): fix typo and update rdoc. diff --git a/lib/rexml/doctype.rb b/lib/rexml/doctype.rb index 678095ae28..0b3c533bb4 100644 --- a/lib/rexml/doctype.rb +++ b/lib/rexml/doctype.rb @@ -248,11 +248,11 @@ module REXML end def to_s - "" + notation = "" + notation end def write( output, indent=-1 ) diff --git a/test/rexml/test_doctype.rb b/test/rexml/test_doctype.rb index f40f833d07..20603f5378 100644 --- a/test/rexml/test_doctype.rb +++ b/test/rexml/test_doctype.rb @@ -65,3 +65,43 @@ class TestDocTypeAccessor < Test::Unit::TestCase end end + +class TestNotationDeclPublic < Test::Unit::TestCase + def setup + @name = "vrml" + @id = "VRML 1.0" + @uri = "http://www.web3d.org/" + end + + def test_to_s + assert_equal("", + decl(@id, nil).to_s) + end + + def test_to_s_with_uri + assert_equal("", + decl(@id, @uri).to_s) + end + + private + def decl(id, uri) + REXML::NotationDecl.new(@name, "PUBLIC", id, uri) + end +end + +class TestNotationDeclSystem < Test::Unit::TestCase + def setup + @name = "gif" + @id = "gif viewer" + end + + def test_to_s + assert_equal("", + decl(@id).to_s) + end + + private + def decl(id) + REXML::NotationDecl.new(@name, "SYSTEM", id, nil) + end +end