Class WriterTester
In: tests/writertester.rb
Parent: NQXMLTester
compare_test_prettify    compare_to_rsrc_xml    expect_error    test_array_arg    test_creating_document    test_entity_substitution    test_no_prettify    test_prettify    test_string_arg    test_writer_errors    test_writing_document   
Public Instance methods

NOTE: this test will break if we add so many nested tags that the writer would start replacing leading spaces with tabs. Since we only have one indentation level, all is well.


Makes sure that writers can accept strings.


Makes sure that writers can accept arrays. Not sure when this would be useful, but what the heck. Arrays respond to '<<', so why not?

expect_error(regex) {|writer| ...}

Creates a writer and passes it in to a block. Expect a parser error that matches `regex'. If line is not nil, expect the error to occur in the specified position(s)

compare_to_rsrc_xml(io, sourceFooToBletch)

Compares the text read from the IO object to a normalized version of @rsrc.xml.


Makes sure that a writer writes what a tree parser parses, except for tag and text differences because of normalization. For example, the tag '<foo/>' will be written as '<foo></foo>'.


Reconstructs @rsrc.xml from document and node objects and compares the result with the tree-parsed version of the origial @rsrc.xml text. Since we already have the entities we need inside @rsrc, lets be lazy and use them. We're really exercising the document object here.