Raise Liquid::ArgumentError on invalid range

This commit is contained in:
Peter Zhu
2020-11-12 16:14:33 -05:00
parent 38600338cf
commit 2cf4b1bd55
2 changed files with 15 additions and 18 deletions
+1 -2
View File
@@ -32,8 +32,7 @@ class ExpressionTest < Minitest::Test
assert_equal(0..0, parse_and_eval("('a'..'b')"))
with_error_mode(:strict) do
e = assert_raises(NoMethodError) { parse_and_eval("(1..(1..5))") }
assert_match(/undefined method `to_i' for 1..5:Range/, e.message)
assert_raises(Liquid::ArgumentError) { parse_and_eval("(1..(1..5))") }
end
end