diff options
Diffstat (limited to 'test/rexml/test_doctype.rb')
-rw-r--r-- | test/rexml/test_doctype.rb | 40 |
1 files changed, 40 insertions, 0 deletions
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("<!NOTATION #{@name} PUBLIC \"#{@id}\">", + decl(@id, nil).to_s) + end + + def test_to_s_with_uri + assert_equal("<!NOTATION #{@name} PUBLIC \"#{@id}\" \"#{@uri}\">", + 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("<!NOTATION #{@name} SYSTEM \"#{@id}\">", + decl(@id).to_s) + end + + private + def decl(id) + REXML::NotationDecl.new(@name, "SYSTEM", id, nil) + end +end |