summaryrefslogtreecommitdiff
path: root/test/rexml
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-26 14:17:24 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-26 14:17:24 +0000
commit75a138732efe3c19e99154eb3f9795d5f93c26ec (patch)
tree0a7da0e7e630d1bde756d47e1f6d918ab1d07c10 /test/rexml
parent41f864faab6f1cdd8ad7e88c9c89fea200d030d2 (diff)
* lib/rexml/parsers/streamparser.rb
(REXML::Parsers::StreamParser#parse): Add "entity" event support to listener. [Bug #8689] [ruby-dev:47542] Reported by Ippei Obayashi. * test/rexml/test_stream.rb (StreamTester#entity): Add a test for the above case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rexml')
-rw-r--r--test/rexml/test_stream.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/rexml/test_stream.rb b/test/rexml/test_stream.rb
index 3f876ae..0ae1bc6 100644
--- a/test/rexml/test_stream.rb
+++ b/test/rexml/test_stream.rb
@@ -63,6 +63,29 @@ class StreamTester < Test::Unit::TestCase
assert( listener.events[:elementdecl] )
assert( listener.events[:notationdecl] )
end
+
+ def test_entity
+ listener = MyListener.new
+ class << listener
+ attr_accessor :entities
+ def entity(content)
+ @entities << content
+ end
+ end
+ listener.entities = []
+
+ source = StringIO.new(<<-XML)
+<!DOCTYPE root [
+<!ENTITY % ISOLat2
+ SYSTEM "http://www.xml.com/iso/isolat2-xml.entities" >
+%ISOLat2;
+]>
+<root/>
+ XML
+ REXML::Document.parse_stream(source, listener)
+
+ assert_equal(["ISOLat2"], listener.entities)
+ end
end