1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Render begin, rescue and ensure in silent script

This commit is contained in:
Takashi Kokubun 2015-05-31 05:38:53 +09:00
parent 08e5a92812
commit 04d0555c11
2 changed files with 15 additions and 1 deletions

View file

@ -10,7 +10,7 @@ module Hamlit
include Concerns::Error
include Concerns::Indentable
INTERNAL_STATEMENTS = %w[else elsif when].freeze
INTERNAL_STATEMENTS = %w[else elsif rescue ensure when].freeze
DEFAULT_SCRIPT_OPTIONS = { force_escape: false, disable_escape: false }.freeze
included do

View file

@ -152,6 +152,20 @@ describe Hamlit::Engine do
HTML
end
it 'renders begin-rescue' do
assert_render(<<-'HAML', <<-HTML)
- begin
- raise 'error'
- rescue
hello
- ensure
world
HAML
hello
world
HTML
end
it 'joins a next line if a current line ends with ","' do
assert_render("- foo = [', \n ']\n= foo", <<-HTML)
[&quot;, &quot;]