Make partial_cache a configurable option

This commit is contained in:
Ian Ker-Seymer
2024-09-23 15:40:49 -04:00
parent b233b3d081
commit 62c9cd88e1
6 changed files with 25 additions and 10 deletions
+2 -2
View File
@@ -40,10 +40,10 @@ module Minitest
def assert_template_result(
expected, template, assigns = {},
message: nil, partials: nil, error_mode: nil, render_errors: false,
template_factory: nil
template_factory: nil, environment: nil
)
file_system = StubFileSystem.new(partials || {})
environment = Liquid::Environment.build(file_system: file_system)
environment ||= Liquid::Environment.build(file_system: file_system)
template = Liquid::Template.parse(template, line_numbers: true, error_mode: error_mode&.to_sym, environment: environment)
registers = Liquid::Registers.new(file_system: file_system, template_factory: template_factory)
context = Liquid::Context.build(static_environments: assigns, rethrow_errors: !render_errors, registers: registers, environment: environment)