mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-04 01:25:14 -07:00
Fix error message 1.8 compatibility
This commit is contained in:
@@ -13,7 +13,7 @@ module Liquid
|
|||||||
def consume(type = nil)
|
def consume(type = nil)
|
||||||
token = @tokens[@p]
|
token = @tokens[@p]
|
||||||
if type && token[0] != type
|
if type && token[0] != type
|
||||||
raise SyntaxError, "Expected #{type} but found #{@tokens[@p]}"
|
raise SyntaxError, "Expected #{type} but found #{@tokens[@p].first}"
|
||||||
end
|
end
|
||||||
@p += 1
|
@p += 1
|
||||||
token[1]
|
token[1]
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ class ErrorHandlingTest < Test::Unit::TestCase
|
|||||||
assert_equal 3, template.warnings.size
|
assert_equal 3, template.warnings.size
|
||||||
assert_equal 'Unexpected character ~ in "~~~"', template.warnings[0].message
|
assert_equal 'Unexpected character ~ in "~~~"', template.warnings[0].message
|
||||||
assert_equal 'Unexpected character % in "{{%%%}}"', template.warnings[1].message
|
assert_equal 'Unexpected character % in "{{%%%}}"', template.warnings[1].message
|
||||||
assert_equal 'Expected id but found [:end_of_string] in "{{ hello. }}"', template.warnings[2].message
|
assert_equal 'Expected id but found end_of_string in "{{ hello. }}"', template.warnings[2].message
|
||||||
assert_equal '', template.render
|
assert_equal '', template.render
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user