gem.gems.haml-3.1.1.test.haml.spec.tests.json Maven / Gradle / Ivy
{
"headers" : {
"an XHTML XML prolog" : {
"haml" : "!!! XML",
"html" : ""
},
"an XHTML default (transitional) doctype" : {
"haml" : "!!!",
"html" : ""
},
"an XHTML 1.1 doctype" : {
"haml" : "!!! 1.1",
"html" : ""
},
"an XHTML 1.2 mobile doctype" : {
"haml" : "!!! mobile",
"html" : ""
},
"an XHTML 1.1 basic doctype" : {
"haml" : "!!! basic",
"html" : ""
},
"an XHTML 1.0 frameset doctype" : {
"haml" : "!!! frameset",
"html" : ""
},
"an HTML 5 doctype with XHTML syntax" : {
"haml" : "!!! 5",
"html" : ""
},
"an HTML 5 XML prolog (silent)" : {
"haml" : "!!! XML",
"html" : "",
"config" : {
"format" : "html5"
}
},
"an HTML 5 doctype" : {
"haml" : "!!!",
"html" : "",
"config" : {
"format" : "html5"
}
},
"an HTML 4 XML prolog (silent)" : {
"haml" : "!!! XML",
"html" : "",
"config" : {
"format" : "html4"
}
},
"an HTML 4 default (transitional) doctype" : {
"haml" : "!!!",
"html" : "",
"config" : {
"format" : "html4"
}
},
"an HTML 4 frameset doctype" : {
"haml" : "!!! frameset",
"html" : "",
"config" : {
"format" : "html4"
}
},
"an HTML 4 strict doctype" : {
"haml" : "!!! strict",
"html" : "",
"config" : {
"format" : "html4"
}
}
},
"basic Haml tags and CSS": {
"a simple Haml tag" : {
"haml" : "%p",
"html" : ""
},
"a self-closing tag (XHTML)" : {
"haml" : "%meta",
"html" : ""
},
"a self-closing tag (HTML4)" : {
"haml" : "%meta",
"html" : "",
"config" : {
"format" : "html4"
}
},
"a self-closing tag (HTML5)" : {
"haml" : "%meta",
"html" : "",
"config" : {
"format" : "html5"
}
},
"a tag with a CSS class" : {
"haml" : "%p.class1",
"html" : ""
},
"a tag with multiple CSS classes" : {
"haml" : "%p.class1.class2",
"html" : ""
},
"a tag with a CSS id" : {
"haml" : "%p#id1",
"html" : ""
},
"a tag with multiple CSS id's" : {
"haml" : "%p#id1#id2",
"html" : ""
},
"a tag with a class followed by an id" : {
"haml" : "%p.class1#id1",
"html" : ""
},
"a tag with an id followed by a class" : {
"haml" : "%p#id1.class1",
"html" : ""
},
"an implicit div with a CSS id" : {
"haml" : "#id1",
"html" : ""
},
"an implicit div with a CSS class" : {
"haml" : ".class1",
"html" : ""
},
"multiple simple Haml tags" : {
"haml" : "%div\n %div\n %p",
"html" : "\n \n \n \n"
}
},
"tags with unusual HTML characters" : {
"a tag with colons" : {
"haml" : "%ns:tag",
"html" : " "
},
"a tag with underscores" : {
"haml" : "%snake_case",
"html" : " "
},
"a tag with dashes" : {
"haml" : "%dashed-tag",
"html" : " "
},
"a tag with camelCase" : {
"haml" : "%camelCase",
"html" : " "
},
"a tag with PascalCase" : {
"haml" : "%PascalCase",
"html" : " "
}
},
"tags with unusual CSS identifiers" : {
"an all-numeric class" : {
"haml" : ".123",
"html" : ""
},
"a class with underscores" : {
"haml" : ".__",
"html" : ""
},
"a class with dashes" : {
"haml" : ".--",
"html" : ""
}
},
"tags with inline content" : {
"a simple tag" : {
"haml" : "%p hello",
"html" : "hello
"
},
"a tag with CSS" : {
"haml" : "%p.class1 hello",
"html" : "hello
"
},
"multiple simple tags" : {
"haml" : "%div\n %div\n %p text",
"html" : "\n \n text
\n \n"
}
},
"tags with nested content" : {
"a simple tag" : {
"haml" : "%p\n hello",
"html" : "\n hello\n
"
},
"a tag with CSS" : {
"haml" : "%p.class1\n hello",
"html" : "\n hello\n
"
},
"multiple simple tags" : {
"haml" : "%div\n %div\n %p\n text",
"html" : "\n \n \n text\n
\n \n"
}
},
"tags with HTML-style attributes": {
"one attribute" : {
"haml" : "%p(a='b')",
"html" : ""
},
"multiple attributes" : {
"haml" : "%p(a='b' c='d')",
"html" : ""
},
"attributes separated with newlines" : {
"haml" : "%p(a='b'\n c='d')",
"html" : ""
},
"an interpolated attribute" : {
"haml" : "%p(a=\"#{var}\")",
"html" : "",
"locals" : {
"var" : "value"
}
},
"'class' as an attribute" : {
"haml" : "%p(class='class1')",
"html" : ""
},
"a tag with a CSS class and 'class' as an attribute" : {
"haml" : "%p.class2(class='class1')",
"html" : ""
},
"a tag with 'id' as an attribute" : {
"haml" : "%p(id='1')",
"html" : ""
},
"a tag with a CSS id and 'id' as an attribute" : {
"haml" : "%p#id(id='1')",
"html" : ""
},
"a tag with a variable attribute" : {
"haml" : "%p(class=var)",
"html" : "",
"locals" : {
"var" : "hello"
}
},
"a tag with a CSS class and 'class' as a variable attribute" : {
"haml" : ".hello(class=var)",
"html" : "",
"locals" : {
"var" : "world"
}
},
"a tag multiple CSS classes (sorted correctly)" : {
"haml" : ".z(class=var)",
"html" : "",
"locals" : {
"var" : "a"
}
}
},
"tags with Ruby-style attributes": {
"one attribute" : {
"haml" : "%p{:a => 'b'}",
"html" : ""
},
"attributes hash with whitespace" : {
"haml" : "%p{ :a => 'b' }",
"html" : ""
},
"an interpolated attribute" : {
"haml" : "%p{:a =>\"#{var}\"}",
"html" : "",
"locals" : {
"var" : "value"
}
},
"multiple attributes" : {
"haml" : "%p{ :a => 'b', 'c' => 'd' }",
"html" : ""
},
"attributes separated with newlines" : {
"haml" : "%p{ :a => 'b',\n 'c' => 'd' }",
"html" : ""
},
"'class' as an attribute" : {
"haml" : "%p{:class => 'class1'}",
"html" : ""
},
"a tag with a CSS class and 'class' as an attribute" : {
"haml" : "%p.class2{:class => 'class1'}",
"html" : ""
},
"a tag with 'id' as an attribute" : {
"haml" : "%p{:id => '1'}",
"html" : ""
},
"a tag with a CSS id and 'id' as an attribute" : {
"haml" : "%p#id{:id => '1'}",
"html" : ""
},
"a tag with a CSS id and a numeric 'id' as an attribute" : {
"haml" : "%p#id{:id => 1}",
"html" : ""
},
"a tag with a variable attribute" : {
"haml" : "%p{:class => var}",
"html" : "",
"locals" : {
"var" : "hello"
}
},
"a tag with a CSS class and 'class' as a variable attribute" : {
"haml" : ".hello{:class => var}",
"html" : "",
"locals" : {
"var" : "world"
}
},
"a tag multiple CSS classes (sorted correctly)" : {
"haml" : ".z{:class => var}",
"html" : "",
"locals" : {
"var" : "a"
}
}
},
"silent comments" : {
"an inline comment" : {
"haml" : "-# hello",
"html" : ""
},
"a nested comment" : {
"haml" : "-#\n hello",
"html" : ""
}
},
"markup comments" : {
"an inline comment" : {
"haml" : "/ comment",
"html" : ""
},
"a nested comment" : {
"haml" : "/\n comment\n comment2",
"html" : ""
}
},
"conditional comments": {
"a conditional comment" : {
"haml" : "/[if IE]\n %p a",
"html" : ""
}
},
"internal filters": {
"content in an 'escaped' filter" : {
"haml" : ":escaped\n <&\">",
"html" : "<&">"
},
"content in a 'preserve' filter" : {
"haml" : ":preserve\n hello\n\n%p",
"html" : "hello
\n"
},
"content in a 'plain' filter" : {
"haml" : ":plain\n hello\n\n%p",
"html" : "hello\n"
},
"content in a 'javascript' filter" : {
"haml" : ":javascript\n a();\n%p",
"html" : "\n"
}
},
"interpolation": {
"interpolation inside inline content" : {
"haml" : "%p #{var}",
"html" : "value
",
"locals" : {
"var" : "value"
}
},
"no interpolation when escaped" : {
"haml" : "%p \\#{var}",
"html" : "#{var}
"
},
"interpolation when the escape character is escaped" : {
"haml" : "%p \\\\#{var}",
"html" : "\\value
",
"locals" : {
"var" : "value"
}
},
"interpolation inside filtered content" : {
"haml" : ":plain\n #{var} interpolated: #{var}",
"html" : "value interpolated: value",
"locals" : {
"var" : "value"
}
}
},
"HTML escaping" : {
"code following '&='" : {
"haml" : "&= '<\"&>'",
"html" : "<"&>"
},
"code following '=' when escape_haml is set to true" : {
"haml" : "= '<\"&>'",
"html" : "<"&>",
"config" : {
"escape_html" : "true"
}
},
"code following '!=' when escape_haml is set to true" : {
"haml" : "!= '<\"&>'",
"html" : "<\"&>",
"config" : {
"escape_html" : "true"
}
}
},
"Boolean attributes" : {
"boolean attribute with XHTML" : {
"haml" : "%input(checked=true)",
"html" : "",
"config" : {
"format" : "xhtml"
}
},
"boolean attribute with HTML" : {
"haml" : "%input(checked=true)",
"html" : "",
"config" : {
"format" : "html5"
}
}
}
}