mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-16 09:20:42 -07:00
19 lines
454 B
Ruby
19 lines
454 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'test_helper'
|
|
|
|
class StrainerTemplateUnitTest < Minitest::Test
|
|
include Liquid
|
|
|
|
def test_add_filter_when_wrong_filter_class
|
|
c = Context.new
|
|
s = c.strainer
|
|
wrong_filter = ->(v) { v.reverse }
|
|
|
|
exception = assert_raises(ArgumentError) do
|
|
s.class.add_filter(wrong_filter)
|
|
end
|
|
assert_equal(exception.message, "Liquid error: wrong argument type Proc (expected Liquid::Filter)")
|
|
end
|
|
end
|