Empact / roxml

ROXML is a module for binding Ruby classes to XML. It supports custom mapping and bidirectional marshalling between Ruby and XML using annotation-style class methods, via Nokogiri or LibXML.
http://roxml.rubyforge.org/
MIT License
223 stars 176 forks source link

One test is failing: ROXML::XML should raise on malformed xml #42

Closed pravi closed 12 years ago

pravi commented 12 years ago
Running tests for ruby1.9.1 using debian/ruby-tests.rb...
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.
/media/forge/debian/diaspora/ruby-roxml-3.2.2/spec/support/nokogiri.rb:2: warning: already initialized constant XML_PARSER
/media/forge/debian/diaspora/ruby-roxml-3.2.2/spec/support/libxml.rb:2: warning: already initialized constant XML_PARSER
......**.........................*..**.*..**....*...*F..*..............................******........................................................*..............................*................................

Pending:
  ROXML#xml overriding output with :to_xml option should output with to_xml filtering
    # Not Yet Implemented
    # 
  ROXML#xml overriding output with #to_xml on the object should output with to_xml filtering
    # Not Yet Implemented
    # 
  ROXML::XMLAttributeRef plain vanilla should output one instance
    # Not Yet Implemented
    # 
  ROXML::XMLAttributeRef when the namespaces are different with :namespace => '*' should collect all instances
    # Test bug?
    # 
  ROXML::XMLAttributeRef when the namespaces are different with :namespace => '*' should output all instances with namespaces
    # Full namespace write support
    # 
  ROXML::XMLObjectRef plain vanilla should output one instance
    # Not Yet Implemented
    # 
  ROXML::XMLObjectRef when the namespaces are different with :namespace => '*' should collect all instances
    # Test bug?
    # 
  ROXML::XMLObjectRef when the namespaces are different with :namespace => '*' should output all instances with namespaces
    # Full namespace write support
    # 
  ROXML::XMLTextRef plain vanilla should output one instance
    # Not Yet Implemented
    # 
  ROXML::XMLTextRef when the namespaces are different with :namespace => '*' should output all instances with namespaces
    # Full namespace write support
    # 
  ROXML with namespaces for writing#to_xml should reproduce the input xml
    # Full namespace write support
    # 
  ROXML#xml_namespaces when an included namespace is not defined in the xml where the missing namespace is the default should raise
    # Not Yet Implemented
    # 
  ROXML#xml_namespaces when an included namespace is not defined in the xml where the missing namespace is the default but the namespace is declared in the body should succeed
    # Not Yet Implemented
    # 
  ROXML#xml_namespaces when an included namespace is not defined in the xml where the missing namespace is included in a namespacey from should raise
    # Not Yet Implemented
    # 
  ROXML#xml_namespaces when an included namespace is not defined in the xml where the missing namespace is included in a namespacey from but the namespace is declared in the body should succeed
    # Not Yet Implemented
    # 
  ROXML#xml_namespaces when an included namespace is not defined in the xml where the missing namespace is included in an explicit :namespace should raise
    # Not Yet Implemented
    # 
  ROXML#xml_namespaces when an included namespace is not defined in the xml where the missing namespace is included in an explicit :namespace but the namespace is declared in the body should succeed
    # Not Yet Implemented
    # 
  ROXML::Definition :as for block shorthand :bool when no value is detected when a literal block is available should pass the value itself to the block
    # Not Yet Implemented
    # 
  WeatherObservation#current_condition should extract icon attribute
    # need to think options through for HappyMapper-style :attributes extensions
    # 

Failures:

  1) ROXML::XML should raise on malformed xml
     Failure/Error: Unable to find matching line from backtrace
     NameError:
       uninitialized constant LibXML
     # ./spec/xml/parser_spec.rb:6:in `block (2 levels) in <top (required)>'

Finished in 0.72903 seconds
213 examples, 1 failure, 19 pending
/media/forge/debian/diaspora/ruby-roxml-3.2.2/lib/roxml.rb:449:in `block (2 levels) in xml_attr': Accessor role is already defined as XML accessor in class Contributor (RuntimeError)
    from /media/forge/debian/diaspora/ruby-roxml-3.2.2/lib/roxml.rb:447:in `tap'
    from /media/forge/debian/diaspora/ruby-roxml-3.2.2/lib/roxml.rb:447:in `block in xml_attr'
    from /media/forge/debian/diaspora/ruby-roxml-3.2.2/lib/roxml.rb:446:in `map'
    from /media/forge/debian/diaspora/ruby-roxml-3.2.2/lib/roxml.rb:446:in `xml_attr'
    from /media/forge/debian/diaspora/ruby-roxml-3.2.2/lib/roxml.rb:462:in `xml_reader'
    from /media/forge/debian/diaspora/ruby-roxml-3.2.2/test/mocks/mocks.rb:26:in `<class:Contributor>'
    from /media/forge/debian/diaspora/ruby-roxml-3.2.2/test/mocks/mocks.rb:23:in `<top (required)>'
    from /media/forge/debian/diaspora/ruby-roxml-3.2.2/test/test_helper.rb:3:in `require_relative'
    from /media/forge/debian/diaspora/ruby-roxml-3.2.2/test/test_helper.rb:3:in `<top (required)>'
    from /media/forge/debian/diaspora/ruby-roxml-3.2.2/test/unit/xml_text_test.rb:1:in `require_relative'
    from /media/forge/debian/diaspora/ruby-roxml-3.2.2/test/unit/xml_text_test.rb:1:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:182:in `block in require'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:547:in `new_constants_in'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:182:in `require'
    from debian/ruby-tests.rb:7:in `block in <main>'
    from debian/ruby-tests.rb:7:in `each'
    from debian/ruby-tests.rb:7:in `<main>'
Empact commented 12 years ago

That failure seems to be caused by debian/ruby-tests.rb running the libxml and nokogiri version of the specs within the same ruby session. Can you point me to that script?

In any case, I've dropped that test e181a51cbae1 as it wasn't really appropriate for the library - it was testing parser behavior which we weren't relying on and which wasn't even common between parsers. So you should be green as of 3.3.0.

pravi commented 12 years ago

This how the tests are run from debian/ruby-tests.rb Dir['{spec,test}/*/.rb'].each { |f| require f }

Now the whole test session itself exit with same error. I'm using 3.3.1

pravi commented 12 years ago
/usr/bin/ruby1.9.1 -I/usr/lib/ruby/vendor_ruby /usr/lib/ruby/vendor_ruby/gem2deb/test_runner.rb
Running tests for ruby1.9.1 using debian/ruby-tests.rb...
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.
/tmp/buildd/ruby-roxml-3.3.1/spec/support/nokogiri.rb:2: warning: already initialized constant XML_PARSER
/tmp/buildd/ruby-roxml-3.3.1/spec/support/libxml.rb:2: warning: already initialized constant XML_PARSER
/tmp/buildd/ruby-roxml-3.3.1/lib/roxml.rb:449:in `block (2 levels) in xml_attr': Accessor role is already defined as XML accessor in class Contributor (RuntimeError)
    from /tmp/buildd/ruby-roxml-3.3.1/lib/roxml.rb:447:in `tap'
    from /tmp/buildd/ruby-roxml-3.3.1/lib/roxml.rb:447:in `block in xml_attr'
    from /tmp/buildd/ruby-roxml-3.3.1/lib/roxml.rb:446:in `map'
    from /tmp/buildd/ruby-roxml-3.3.1/lib/roxml.rb:446:in `xml_attr'
    from /tmp/buildd/ruby-roxml-3.3.1/lib/roxml.rb:462:in `xml_reader'
    from /tmp/buildd/ruby-roxml-3.3.1/test/mocks/mocks.rb:26:in `<class:Contributor>'
    from /tmp/buildd/ruby-roxml-3.3.1/test/mocks/mocks.rb:23:in `<top (required)>'
    from /tmp/buildd/ruby-roxml-3.3.1/test/test_helper.rb:3:in `require_relative'
    from /tmp/buildd/ruby-roxml-3.3.1/test/test_helper.rb:3:in `<top (required)>'
    from /tmp/buildd/ruby-roxml-3.3.1/test/unit/xml_text_test.rb:1:in `require_relative'
    from /tmp/buildd/ruby-roxml-3.3.1/test/unit/xml_text_test.rb:1:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:182:in `block in require'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:547:in `new_constants_in'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:182:in `require'
    from debian/ruby-tests.rb:7:in `block in <main>'
    from debian/ruby-tests.rb:7:in `each'
    from debian/ruby-tests.rb:7:in `<main>'
ERROR: Test "ruby1.9.1" failed. Exiting.

test_runner.rb is http://anonscm.debian.org/gitweb/?p=pkg-ruby-extras/gem2deb.git;a=blob;f=lib/gem2deb/test_runner.rb;h=5b4a7300562e43e410f61b64686f8a3872710f00;hb=HEAD