# Run from your Rails main directory require 'test/test_helper' class TestHaml < Test::Unit::TestCase def setup @base = ActionView::Base.new end def assert_haml_renders(expected, input) actual = Haml::Engine.new(input).to_html(@base) assert_equal expected, actual end def test_haml_engine assert_haml_renders <
OUT %div{:foo => @foo}/ %div{:foo => @foo.mark_as_xss_protected}/ IN # Note that '/" explicitly marked as XSS-protected can break validity end end