1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/xsd/test_noencoding.rb
nahi d83e21d15d * lib/rexml/encodings/US-ASCII.rb: typo. [ruby-talk:88650]
* test/ruby/test_system.rb: num of asserts depended on running dir.

        * test/xsd/test_noencoding.rb: rexml + without iconv/uconv cannot
          handle euc-jp.  install iconv, uconv or xmlscan.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-23 07:13:59 +00:00

32 lines
682 B
Ruby

require 'test/unit'
require 'wsdl/xmlSchema/parser'
module XSD
class TestEmptyCharset < Test::Unit::TestCase
def setup
@file = File.join(File.dirname(File.expand_path(__FILE__)), 'noencoding.xml')
end
def test_wsdl
begin
xml = WSDL::XMLSchema::Parser.new.parse(File.open(@file) { |f| f.read })
rescue RuntimeError
if XSD::XMLParser.const_defined?("REXMLParser")
STDERR.puts("rexml cannot handle euc-jp without iconv/uconv.")
return
end
raise
rescue Errno::EINVAL
# unsupported encoding
return
end
assert_equal(WSDL::XMLSchema::Schema, xml.class)
assert_equal(0, xml.collect_elements.size)
end
end
end