Render tag styling fixes

This commit is contained in:
Mike Angell 2019-08-31 22:48:25 +10:00
parent ddb45cd658
commit 604d899496
3 changed files with 6 additions and 6 deletions

View File

@ -1,13 +1,13 @@
module Liquid
class Render < Tag
Syntax = /(#{QuotedString})#{QuotedFragment}*/o
SYNTAX = /(#{QuotedString})#{QuotedFragment}*/o
attr_reader :template_name_expr, :attributes
def initialize(tag_name, markup, options)
super
raise SyntaxError.new(options[:locale].t("errors.syntax.render".freeze)) unless markup =~ Syntax
raise SyntaxError.new(options[:locale].t("errors.syntax.render".freeze)) unless markup =~ SYNTAX
template_name = $1

View File

@ -110,7 +110,7 @@ class RenderTagTest < Minitest::Test
file_system = StubFileSystem.new('snippet' => 'echo')
assert_equal 'echoecho',
Template.parse('{% render "snippet" %}{% render "snippet" %}')
.render!({}, registers: { file_system: file_system })
.render!({}, registers: { file_system: file_system })
assert_equal 1, file_system.file_read_count
end

View File

@ -4,7 +4,7 @@ class PartialCacheUnitTest < Minitest::Test
def test_uses_the_file_system_register_if_present
context = Liquid::Context.build(
registers: {
file_system: StubFileSystem.new('my_partial' => 'my partial body')
file_system: StubFileSystem.new('my_partial' => 'my partial body'),
}
)
@ -41,12 +41,12 @@ class PartialCacheUnitTest < Minitest::Test
)
context_one = Liquid::Context.build(
registers: {
file_system: shared_file_system
file_system: shared_file_system,
}
)
context_two = Liquid::Context.build(
registers: {
file_system: shared_file_system
file_system: shared_file_system,
}
)