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:
parent
7c91459e71
commit
67ec6d12bc
2 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
[", "]
|
||||
|
|
Loading…
Reference in a new issue