mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
added tag to increment a variable each time it is referenced
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
require File.dirname(__FILE__) + '/helper'
|
||||
|
||||
|
||||
class IncTagTest < Test::Unit::TestCase
|
||||
include Liquid
|
||||
|
||||
def test_inc
|
||||
assert_template_result('0','{%inc port %}')
|
||||
assert_template_result('0 1','{%inc port %} {%inc port%}')
|
||||
assert_template_result('0 0 1 2 1',
|
||||
'{%inc port %} {%inc starboard%} ' +
|
||||
'{%inc port %} {%inc port%} ' +
|
||||
'{%inc starboard %}')
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user