Workaround to fix lineno

This commit is contained in:
Takashi Kokubun 2015-10-24 22:23:25 +09:00
parent b5939a3568
commit 3d7470989c
1 changed files with 3 additions and 5 deletions

View File

@ -29,17 +29,15 @@ module RenderAssertion
options = options.dup
options.delete(:compatible_only)
options.delete(:error_with)
options = { escape_html: true, ugly: true}.merge(options)
options = { escape_html: true, ugly: true }.merge(options)
haml, html = haml.unindent, html.unindent
assert_equal html, render(haml, options)
end
def render(text, options = {}, base = nil, &block)
def render(text, options = {}, &block)
scope = options.delete(:scope) || Object.new
locals = options.delete(:locals) || {}
engine = Hamlit::HamlEngine.new(text, options)
return engine.to_html(base) if base
engine.to_html(scope, locals, &block)
eval Hamlit::HamlEngine.new(text, options).precompiled
end
end