From 3d7470989c196b9779d71758c3d0f78ac56ade7c Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sat, 24 Oct 2015 22:23:25 +0900 Subject: [PATCH] Workaround to fix lineno --- test/test_helper.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index 1a8f763b..4bfcd784 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -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