Sha256: c8a94ea56c8e19a1c8872f90e0c00b97be6ec812d63c69cbfb470301b0c52b18

Contents?: true

Size: 717 Bytes

Versions: 2

Compression:

Stored size: 717 Bytes

Contents

#! /usr/bin/env ruby
require File.dirname(__FILE__) + '/test_helper.rb'
require 'gonzui/webapp/xmlformatter'
require '_test-util'

class XMLFormatterTest < 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("<html\n><head\n><title\n>foo</title\n></head\n><body\n><h1\n><a href=\"foo&lt;&amp;&quot;&gt;.html\"\n>foo&lt;&amp;&quot;&gt;</a\n></h1\n><p\n>hello</p\n></body\n></html\n>",
                 result)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gonzui-1.2-x86-mswin32-60 test/test_webapp-xmlformatter.rb
gonzui-1.2 test/test_webapp-xmlformatter.rb