File: hash_ordering_test.rb

package info (click to toggle)
ruby-liquid 5.4.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,176 kB
  • sloc: ruby: 10,561; makefile: 6
file content (25 lines) | stat: -rw-r--r-- 494 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

require 'test_helper'

class HashOrderingTest < Minitest::Test
  module MoneyFilter
    def money(input)
      format(' %d$ ', input)
    end
  end

  module CanadianMoneyFilter
    def money(input)
      format(' %d$ CAD ', input)
    end
  end

  include Liquid

  def test_global_register_order
    with_global_filter(MoneyFilter, CanadianMoneyFilter) do
      assert_equal(" 1000$ CAD ", Template.parse("{{1000 | money}}").render(nil, nil))
    end
  end
end