Sha256: e86676f1994eaa29dacf27de54e77ea91dc9e55be9110047c548094541bc93c7

Contents?: true

Size: 636 Bytes

Versions: 2

Compression:

Stored size: 636 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', 'test_helper')

class TestROXML < Test::Unit::TestCase
  # Malformed XML parsing should throw REXML::ParseException
  def test_malformed
    ROXML::XML::Parser.register_error_handler {|err| }
    assert_raise ROXML::XML::Parser::ParseError do
      book = Book.parse(fixture(:book_malformed))
    end
  end

  # Verify that an exception is thrown when two accessors have the same
  # name in a ROXML class.
  def test_duplicate_accessor
    assert_raise RuntimeError do
      Class.new do
        include ROXML

        xml_reader :id
        xml_accessor :id
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
Empact-roxml-2.0 test/unit/roxml_test.rb
Empact-roxml-2.1 test/unit/roxml_test.rb