Updated MSpec source to 1c3ee1c8.
[rbx.git] / test / mri / xsd / test_noencoding.rb
blob48119ec1f7988430ca9e8e97b34e2d4c3299f1b1
1 require 'test/unit'
2 require 'wsdl/xmlSchema/parser'
5 module XSD
8 class TestEmptyCharset < Test::Unit::TestCase
9   def setup
10     @file = File.join(File.dirname(File.expand_path(__FILE__)), 'noencoding.xml')
11   end
13   def test_wsdl
14     begin
15       xml = WSDL::XMLSchema::Parser.new.parse(File.open(@file) { |f| f.read })
16     rescue RuntimeError
17       if XSD::XMLParser.const_defined?("REXMLParser")
18         STDERR.puts("rexml cannot handle euc-jp without iconv/uconv.")
19         return
20       end
21       raise
22     rescue Errno::EINVAL
23       # unsupported encoding
24       return
25     end
26     assert_equal(WSDL::XMLSchema::Schema, xml.class)
27     assert_equal(0, xml.collect_elements.size)
28   end
29 end
32 end