# encoding: utf-8 class Nanoc3::Helpers::HTMLEscapeTest < MiniTest::Unit::TestCase include Nanoc3::TestHelpers include Nanoc3::Helpers::HTMLEscape def test_html_escape_with_string assert_equal('<', html_escape('<')) assert_equal('>', html_escape('>')) assert_equal('&', html_escape('&')) assert_equal('"', html_escape('"')) end def test_html_escape_with_block _erbout = 'moo' html_escape do _erbout << '

Looks like a header

' end assert_equal 'moo<h1>Looks like a header</h1>', _erbout end def test_html_escape_without_string_or_block assert_raises RuntimeError do h end end end