2003-11-29 23:33:02 -05:00
|
|
|
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
|
2003-12-22 21:12:10 -05:00
|
|
|
begin
|
|
|
|
xml = WSDL::XMLSchema::Parser.new.parse(File.open(@file) { |f| f.read })
|
2003-12-23 02:13:59 -05:00
|
|
|
rescue RuntimeError
|
|
|
|
if XSD::XMLParser.const_defined?("REXMLParser")
|
|
|
|
STDERR.puts("rexml cannot handle euc-jp without iconv/uconv.")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
raise
|
2003-12-22 21:12:10 -05:00
|
|
|
rescue Errno::EINVAL
|
|
|
|
# unsupported encoding
|
|
|
|
return
|
|
|
|
end
|
2003-11-29 23:33:02 -05:00
|
|
|
assert_equal(WSDL::XMLSchema::Schema, xml.class)
|
|
|
|
assert_equal(0, xml.collect_elements.size)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|