/**
* Tests if writing out a pre element keeps white-spaces.
*/
public void testPre() throws Exception {
final DOMOutputBuffer rootBuffer = new TestDOMOutputBuffer();
final MarinerPageContext context = protocol.getMarinerPageContext();
context.pushOutputBuffer(rootBuffer);
final PreAttributes attributes = new PreAttributes();
attributes.setStyles(StylesBuilder.getInitialValueStyles());
final EmphasisAttributes emphasisAttrs = new EmphasisAttributes();
protocol.writeOpenPre(attributes);
final DOMOutputBuffer buffer =
(DOMOutputBuffer) context.getCurrentOutputBuffer();
assertNotEquals(rootBuffer, buffer);
buffer.writeText(" before ");
protocol.writeOpenEmphasis(emphasisAttrs);
context.getCurrentOutputBuffer().writeText(" child text ");
protocol.writeCloseEmphasis(emphasisAttrs);
buffer.writeText(" after ");
protocol.writeClosePre(attributes);
// check the result