test/integration/assign_test.rb in liquid-3.0.0 vs test/integration/assign_test.rb in liquid-3.0.1
- old
+ new
@@ -1,9 +1,19 @@
require 'test_helper'
class AssignTest < Minitest::Test
include Liquid
+ def test_assign_with_hyphen_in_variable_name
+ template_source = <<-END_TEMPLATE
+ {% assign this-thing = 'Print this-thing' %}
+ {{ this-thing }}
+ END_TEMPLATE
+ template = Template.parse(template_source)
+ rendered = template.render!
+ assert_equal "Print this-thing", rendered.strip
+ end
+
def test_assigned_variable
assert_template_result('.foo.',
'{% assign foo = values %}.{{ foo[0] }}.',
'values' => %w{foo bar baz})