require 'helper' class TestSlimHtmlStructure < TestSlim def test_simple_render # Keep the trailing space behind "body "! source = %q{ Simple Test Title Hello World, meet Slim. } assert_html "Simple Test Title\n

Hello World, meet Slim.

", source end def test_html_tag_with_text_and_empty_line # Keep the trailing space behind "body "! source = %q{

Hello

World } assert_html "

Hello

\n

World

", source end def test_html_namespaces source = %q{ Text } assert_html 'Text', source end def test_doctype source = %q{ ', source, :format => :xhtml end def test_doctype_new_syntax source = %q{ ', source, :format => :xhtml end def test_doctype_new_syntax_html5 source = %q{ ', source, :format => :xhtml end def test_render_with_shortcut_attributes source = %q{ This is my title <#notice.hello.world = hello_world } assert_html %Q{

This is my title

\n
Hello World from @env
}, source end def test_render_with_overwritten_default_tag source = %q{
Hello World from @env
', source, :default_tag => 'section' end def test_render_with_text_block source = %q{

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

', source end def test_render_with_text_block_with_subsequent_markup source = %q{

Some more markup } assert_html "

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

\n

Some more markup

", source end def test_render_with_text_block_with_trailing_whitespace source = %q{

this is > a link to page } assert_html "

this is\n a link to\npage

", source end def test_nested_text source = %q{

This is line one. > This is line two. > This is line three. > This is line four.

This is a new paragraph. } assert_html "

This is line one.\n This is line two.\n This is line three.\n This is line four.

\n

This is a new paragraph.

", source end def test_nested_text_with_nested_html_one_same_line source = %q{

This is line two. This is a bold line in the paragraph. > This is more content. } assert_html "

This is line one.\n This is line two.\nThis is a bold line in the paragraph.\n This is more content.

", source end def test_nested_text_with_nested_html_one_same_line2 source = %q{

This is line two. This is a bold line in the paragraph. > This is more content. } assert_html "

This is line one.\n This is line two.\nThis is a bold line in the paragraph.\n This is more content.

", source end def test_nested_text_with_nested_html source = %q{

This is line one. > This is line two. > This is line three. > This is line four. This is a bold line in the paragraph. > This is more content. } assert_html "

This is line one.\n This is line two.\n This is line three.\n This is line four.\nThis is a bold line in the paragraph.\n This is more content.

", source end def test_simple_paragraph_with_padding source = %q{

There will be 3 spaces in front of this line. } assert_html '

There will be 3 spaces in front of this line.

', source end def test_paragraph_with_nested_text source = %q{

This is line one. > This is line two. } assert_html "

This is line one.\n This is line two.

", source end def test_paragraph_with_padded_nested_text source = %q{

This is line one. > This is line two. } assert_html "

This is line one.\n This is line two.

", source end def test_paragraph_with_attributes_and_nested_text source = %q{ This is line one. This is line two. } assert_html "

This is line one.\nThis is line two.

", source end def test_output_code_with_leading_spaces source = %q{

= hello_world

= hello_world

=hello_world } assert_html "

Hello World from @env

\n

= hello_world

\n

=hello_world

", source end def test_single_quoted_attributes source = %q{

= output_number } assert_html '

1337

', source end def test_nonstandard_attributes source = %q{

= output_number } assert_html '

1337

', source end def test_nonstandard_shortcut_attributes source = %q{ = output_number } assert_html '

1337

', source end def test_dashed_attributes source = %q{

= output_number } assert_html '

1337

', source end def test_dashed_attributes_with_shortcuts source = %q{ = output_number } assert_html '

1337

', source end def test_parens_around_attributes source = %q{

= output_number } assert_html '

= output_number

', source end def test_square_brackets_around_attributes source = %q{

= output_number } assert_html '

= output_number

', source end def test_parens_around_attributes_with_equal_sign_snug_to_right_paren source = %q{

= output_number } assert_html '

1337

', source end def test_static_empty_attribute source = %q{

= output_number } assert_html '

1337

', source end def test_dynamic_empty_attribute source = %q{

= output_number } assert_html '

1337

', source end def test_closed_tag source = %q{ } assert_html '', source, :format => :xhtml end def test_attributs_with_parens_and_spaces source = %q{