mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
Ruby 1.9+ uses Minitest as the backend for Test::Unit. As of Minitest 5, the shim has broken some compatibility with Test::Unit::TestCase in some scenarios. Adjusts the test suite to support Minitest 5's syntax. Minitest versions 4 and below do not support the newer Minitest::Test class that arrived in version 5. For that case, use the MiniTest::Unit::TestCase class as a fallback Conflicts: test/integration/tags/for_tag_test.rb test/test_helper.rb
26 lines
466 B
Ruby
26 lines
466 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 < Minitest::Test
|
|
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
|