require 'helper' class TestSlimRubyErrors < TestSlim =begin multi def test_multline_attribute source = %q{
'test.slim' end =end def test_broken_output_line source = %q{
= hello_world + \ hello_world + \ unknown_ruby_method } # FIXME: Remove this hack! # This is actually a jruby issue. Jruby reports a wrong # line number 1 in this case: # # test = 1+\ # unknown_variable if RUBY_PLATFORM == "java" assert_ruby_error NameError, "test.slim:2", source, :file => 'test.slim' else assert_ruby_error NameError, "test.slim:4", source, :file => 'test.slim' end end def test_broken_output_line2 source = %q{
= hello_world + \ hello_world
Hello = unknown_ruby_method } assert_ruby_error NameError,"(__TEMPLATE__):5", source end def test_output_block source = %q{
= hello_world "Hello Ruby" do = unknown_ruby_method } assert_ruby_error NameError,"(__TEMPLATE__):3", source end def test_output_block2 source = %q{
= hello_world "Hello Ruby" do = "Hello from block"
Text line 1
Text line 2
= unknown_ruby_method
}
assert_ruby_error NameError,"(__TEMPLATE__):4", source
end
def test_text_block2
source = %q{
> Text line 1
> Text line 2
= unknown_ruby_method
}
assert_ruby_error NameError,"(__TEMPLATE__):5", source
end
def test_comment
source = %q{
# Comment line 1
# Comment line 2
= unknown_ruby_method
}
assert_ruby_error NameError,"(__TEMPLATE__):4", source
end
def test_embedded_ruby1
source = %q{