one
\n\n +two
\n +one
\n\n +two
\n +], x.target! end def test_traceback_style_override x = HtmlMarkup.new x.html {_body?(:traceback_style => 'color:red') {boom}} assert_match %r['traceback') {boom}} assert_match %r[\s*\s*], x.target! end def test_nil_attribute x = HtmlMarkup.new x.html {_div :class => nil} assert_match %r[^ ], x.target! end def test_class_attribute x = HtmlMarkup.new x.html {_div.header {_span.text 'foo'}} assert_match %r[.*]m, x.target! end def test_id_attribute x = HtmlMarkup.new x.html {_h1.content! 'Content'} assert_match %r[^Content
], x.target! end def test_boolean_attribute_false x = HtmlMarkup.new x.html {_option :selected => false} assert_match %r[^ ], x.target! end def test_boolean_attribute_true x = HtmlMarkup.new x.html {_option :selected => true} assert_match %r[^ ], x.target! end def test_indented_text x = HtmlMarkup.new x.html {_div {_ 'text'}} assert_match %r[^\n text\n], x.target! end def test_unindented_text x = HtmlMarkup.new x.html {_div {_! "text\n"}} assert_match %r[^\ntext\n], x.target! end def test_declare x = HtmlMarkup.new x._.declare :DOCTYPE, 'html' assert_equal %{\n}, x.target! end def test_comment x = HtmlMarkup.new x._.comment 'foo' assert_equal %{\n}, x.target! end def test_svg x = HtmlMarkup.new x.html {_svg} assert_match %r[^ ], x.target! end def test_math x = HtmlMarkup.new x.html {_math} assert_match %r[^ ], x.target! end begin require 'coffee-script' def test_coffeescript x = HtmlMarkup.new x.html {_coffeescript 'alert "foo"'} assert_match %r[]x, x.target! end rescue LoadError end end