#! /usr/bin/env ruby require File.dirname(__FILE__) + '/test_helper.rb' require 'gonzui/webapp/xmlformatter' require '_test-util' class UtilTest < Test::Unit::TestCase def test_format_xml html = [:html] head = [:head, [:title, "foo"]] body = [:body, [:h1, [:a, {:href => 'foo<&">.html'}, 'foo<&">']]] body.push([:p, "hello"]) html.push(head) html.push(body) formatter = Gonzui::XMLFormatter.new result = formatter.format(html) assert_equal("
hello
", result) end end