mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
Remove Condition.operators feature that let you define operators
It was incompatible with the lexer anyway. Not used internally either.
This commit is contained in:
@@ -136,15 +136,6 @@ class ConditionUnitTest < Minitest::Test
|
|||||||
assert_equal(false, condition.evaluate(Context.new))
|
assert_equal(false, condition.evaluate(Context.new))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_should_allow_custom_proc_operator
|
|
||||||
Condition.operators['starts_with'] = proc { |_cond, left, right| left =~ /^#{right}/ }
|
|
||||||
|
|
||||||
assert_evaluates_true('bob', 'starts_with', 'b')
|
|
||||||
assert_evaluates_false('bob', 'starts_with', 'o')
|
|
||||||
ensure
|
|
||||||
Condition.operators.delete('starts_with')
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_left_or_right_may_contain_operators
|
def test_left_or_right_may_contain_operators
|
||||||
@context = Liquid::Context.new
|
@context = Liquid::Context.new
|
||||||
@context['one'] = @context['another'] = "gnomeslab-and-or-liquid"
|
@context['one'] = @context['another'] = "gnomeslab-and-or-liquid"
|
||||||
|
|||||||
Reference in New Issue
Block a user