require 'helper' class TestSlimCodeEvaluation < TestSlim def test_render_with_call_to_set_attributes source = %q{

= hello_world } assert_html '

Hello World from @env

', source end def test_render_with_call_to_set_custom_attributes source = %q{

="hello world" = hello_world } assert_html '

Hello World from @env

', source end def test_render_with_call_to_set_attributes_and_call_to_set_content source = %q{

= hello_world } assert_html '

Hello World from @env

', source end def test_render_with_parameterized_call_to_set_attributes_and_call_to_set_content source = %q{

= hello_world("Hello Ruby!") } assert_html '

Hello Ruby!

', source end def test_render_with_spaced_parameterized_call_to_set_attributes_and_call_to_set_content source = %q{

= hello_world "Hello Ruby!" } assert_html '

Hello Ruby!

', source end def test_render_with_spaced_parameterized_call_to_set_attributes_and_call_to_set_content_2 source = %q{

= hello_world "Hello Ruby!", :dummy => "value" } assert_html '

Hello Ruby!dummy value

', source end def test_hash_call_in_attribute source = %q{

Test it } assert_html '

Test it

', source end def test_instance_variable_in_attribute_without_quotes source = %q{

} assert_html '

', source end def test_method_call_in_attribute_without_quotes source = %q{
', source end def test_ruby_attribute_with_unbalanced_delimiters source = %q{
} assert_html '
', source end def test_method_call_in_delimited_attribute_without_quotes source = %q{
} assert_html '
', source end def test_method_call_in_delimited_attribute_without_quotes2 source = %q{
} assert_html '
', source end def test_bypassing_escape_in_attribute source = %q{
} assert_html '
', source end def test_hash_call_in_attribute_without_quotes source = %q{

Test it } assert_html '

Test it

', source end def test_hash_call_in_delimited_attribute source = %q{

Test it } assert_html '

Test it

', source end def test_hash_call_in_attribute_with_ruby_evaluation source = %q{

Test it } assert_html '

Test it

', source end def test_hash_call_in_delimited_attribute_with_ruby_evaluation source = %q{

Test it } assert_html '

Test it

', source end def test_hash_call_in_delimited_attribute_with_ruby_evaluation_2 source = %q{

Test it } assert_html '

Test it

', source end def test_hash_call_in_delimited_attribute_with_ruby_evaluation_3 source = %q{

Test it } assert_html '

Test it

', source end def test_hash_call_in_delimited_attribute_with_ruby_evaluation_4 source = %q{

Test it } assert_html '

Test it

', source end def test_hash_call_in_delimited_attribute_with_ruby_evaluation_5 source = %q{

Test it } assert_html '

Test it

', source end def test_computation_in_attribute source = %q{

Test it } assert_html '

Test it

', source end def test_number_type_interpolation source = %q{

= output_number } assert_html '

1337

', source end def test_ternary_operation_in_attribute source = %q{

= output_number } assert_html '

1337

', source end def test_class_attribute_merging source = %{ <.alpha class="beta">Test it } assert_html '
Test it
', source end def test_class_attribute_merging_with_nil source = %{ <.alpha class="beta" class=nil class="gamma">Test it } assert_html '
Test it
', source end def test_id_attribute_merging source = %{ <#alpha id="beta">Test it } assert_html '
Test it
', source, :attr_delimiter => {'class' => ' ', 'id' => '_' } end def test_id_attribute_merging2 source = %{ <#alpha id="beta">Test it } assert_html '
Test it
', source, :attr_delimiter => {'class' => ' ', 'id' => '-' } end def test_boolean_attribute_false source = %{ ', source end def test_boolean_attribute_true source = %{ ', source end def test_boolean_attribute_dynamic source = %{ ', source end def test_boolean_attribute_nil source = %{ ', source end def test_boolean_attribute_string2 source = %{ ', source end def test_boolean_attribute_shortcut source = %{ ', source end def test_array_attribute source = %{ <.alpha class="beta" class=#{[:gamma, nil, :delta, [true, false]]} } assert_html '
', source end end