summaryrefslogtreecommitdiff
path: root/test/rexml/test_listener.rb
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-17 13:15:37 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-17 13:15:37 +0000
commitd357d7279ab23275b769b594a2c4670797afc353 (patch)
treecaf1db41f169c090ff4de0f675efe466154b2e34 /test/rexml/test_listener.rb
parent91ed484f92040e5c2006a3a00ec77a54d552cf37 (diff)
* test/rexml/test_listener.rb: remove needless codes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rexml/test_listener.rb')
-rw-r--r--test/rexml/test_listener.rb83
1 files changed, 1 insertions, 82 deletions
diff --git a/test/rexml/test_listener.rb b/test/rexml/test_listener.rb
index 645b857..e52a7e2 100644
--- a/test/rexml/test_listener.rb
+++ b/test/rexml/test_listener.rb
@@ -1,5 +1,5 @@
# coding: binary
-require 'test/unit/testcase'
+
require 'rexml/document'
require 'rexml/streamlistener'
@@ -96,76 +96,6 @@ class BaseTester < Test::Unit::TestCase
end
end
-#########################################################
-# Other parsers commented out because they cause failures
-# in the unit tests, which aren't REXMLs problems
-# #######################################################
-=begin
-begin
- require 'xmlparser'
- class MyXMLParser
- class Listener < XML::Parser
- # Dummy handler to get XML::Parser::XML_DECL event.
- def xmlDecl; end
- end
-
- def parse( stringOrReadable )
- text = ""
- Listener.new.parse( stringOrReadable ) do | type, name, data |
- case type
- when XML::Parser::CDATA
- text << data
- end
- end
- text
- end
- end
-
- class XMLParserTester < BaseTester
- def setup
- @listener = MyXMLParser.new
- end
- end
-rescue LoadError
- #puts "XMLParser not available"
-end
-
-begin
- require 'nqxml/tokenizer'
- class MyNQXMLLightWeightListener
- def parse( stringOrReadable )
- text = ""
- isText = false
- tokenizer = NQXML::Tokenizer.new( stringOrReadable )
- tokenizer.each do | entity |
- case entity
- when NQXML::Tag
- if !entity.isTagEnd
- isText = true
- else
- isText = false
- end
- when NQXML::Text
- if isText
- text << entity.text
- isText = false
- end
- end
- end
- text
- end
- end
-
- class NQXMLTester < BaseTester
- def setup
- @listener = MyNQXMLLightWeightListener.new
- end
- end
-rescue LoadError
- #puts "NQXML not available"
-end
-=end
-
class MyREXMLListener
include REXML::StreamListener
@@ -194,14 +124,3 @@ class REXMLTester < BaseTester
assert_equal( t6.strip, REXML::Document.new(t6).to_s )
end
end
-
-if __FILE__ == $0
- case ARGV[0]
- when 'NQXML'
- RUNIT::CUI::TestRunner.run( NQXMLTester.suite )
- when 'XMLParser'
- RUNIT::CUI::TestRunner.run( XMLParserTester.suite )
- else
- RUNIT::CUI::TestRunner.run( REXMLTester.suite )
- end
-end