1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
haml--haml/test/template_test_helper.rb
2017-02-07 22:58:26 +09:00

38 lines
645 B
Ruby

module TemplateTestHelper
TEMPLATE_PATH = File.join(__dir__, "templates")
end
module Haml::Filters::Test
include Haml::Filters::Base
def render(text)
"TESTING HAHAHAHA!"
end
end
module Haml::Helpers
def test_partial(name, locals = {})
Haml::Engine.new(File.read(File.join(TemplateTestHelper::TEMPLATE_PATH, "_#{name}.haml")), Haml::Template.options).render(self, locals)
end
end
class Egocentic
def method_missing(*args)
self
end
end
class DummyController
attr_accessor :logger
def initialize
@logger = Egocentic.new
end
def self.controller_path
''
end
def controller_path
''
end
end