describe Hamlit::Engine do describe 'tag' do it 'renders one-line tag' do assert_render(<<-HAML, <<-HTML) %span hello HAML hello HTML end it 'renders multi-line tag' do assert_render(<<-HAML, <<-HTML) %span hello HAML hello HTML end it 'renders a nested tag' do assert_render(<<-HAML, <<-HTML) %span %b hello %i %small world HAML hello world HTML end it 'renders multi-line texts' do assert_render(<<-HAML, <<-HTML) %span %b hello world HAML hello world HTML end it 'skips empty lines' do assert_render(<<-HAML, <<-HTML) %span %b hello HAML hello HTML end it 'renders classes' do assert_render(<<-HAML, <<-HTML) %span.foo-1.bar_A hello HAML HTML end it 'renders ids only last one' do assert_render(<<-HAML, <<-HTML) %span#Bar_0#bar- hello HAML hello HTML end it 'renders ids and classes' do assert_render(<<-HAML, <<-HTML) %span#a.b#c.d hello HAML hello HTML end it 'renders implicit div tag starting with id' do assert_render(<<-HAML, <<-HTML) #hello.world HAML
HTML end it 'renders implicit div tag starting with class' do assert_render(<<-HAML, <<-HTML) .world#hello foo HAML