spec/hamlit/engine/text_spec.rb in hamlit-1.6.4 vs spec/hamlit/engine/text_spec.rb in hamlit-1.6.5

- old
+ new

@@ -217,7 +217,23 @@ specify { assert_render(%q{'"!@$%^&*|=#{1}1#{1}2}, %Q{'"!@$%^&*|=1112\n}) } specify { assert_render('あ#{1}', "あ1\n") } specify { assert_render('あ#{"い"}う', "あいう\n") } specify { assert_render('a#{"<b>"}c', "a&lt;b&gt;c\n") } end + + describe 'illegal inputs' do + it 'rejects an invalid tag' do + expect { render_string(<<-HAML.unindent) }. + % a + HAML + to raise_error(Hamlit::SyntaxError, 'Invalid tag: "% a".') + end + + it 'rejects an invalid tag' do + expect { render_string(<<-HAML.unindent) }. + %.foo + HAML + to raise_error(Hamlit::SyntaxError, 'Invalid tag: "%.foo".') + end + end end end