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

Accept hashed error for rescue

This commit is contained in:
Takashi Kokubun 2015-06-02 08:10:39 +09:00
parent 7c91459e71
commit 67ec6d12bc
2 changed files with 12 additions and 0 deletions

View file

@ -14,6 +14,7 @@ module Hamlit
DEFAULT_SCRIPT_OPTIONS = { force_escape: false, disable_escape: false }.freeze
PREFIX_BY_STATEMENT = {
'when' => 'case',
'rescue' => 'begin',
}.freeze
included do

View file

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