mirror of
https://github.com/kemko/liquid.git
synced 2026-01-02 16:25:42 +03:00
This makes it easier to re-use the integration tests in a seperate gem that optimizes parts of liquid with a native implementation.
26 lines
472 B
Ruby
26 lines
472 B
Ruby
require 'test_helper'
|
|
|
|
module MoneyFilter
|
|
def money(input)
|
|
sprintf(' %d$ ', input)
|
|
end
|
|
end
|
|
|
|
module CanadianMoneyFilter
|
|
def money(input)
|
|
sprintf(' %d$ CAD ', input)
|
|
end
|
|
end
|
|
|
|
class HashOrderingTest < Test::Unit::TestCase
|
|
include Liquid
|
|
|
|
def test_global_register_order
|
|
Template.register_filter(MoneyFilter)
|
|
Template.register_filter(CanadianMoneyFilter)
|
|
|
|
assert_equal " 1000$ CAD ", Template.parse("{{1000 | money}}").render(nil, nil)
|
|
end
|
|
|
|
end
|