More descriptive exception

This commit is contained in:
David Zhang 2016-07-14 11:27:47 +08:00
parent 5e760a206a
commit b1f9a0809c
2 changed files with 2 additions and 2 deletions

View File

@ -273,7 +273,7 @@ module Jekyll
begin
input.to_i
rescue
raise ArgumentError, "Invalid input object type."
raise ArgumentError, "Object '#{input.inspect}' could not be converted into an integer."
end
end

View File

@ -645,7 +645,7 @@ class TestFilters < JekyllUnitTest
context "to_integer filter" do
should "raise Exception when input is not integer or string" do
err_msg = "Invalid input object type."
err_msg = "Object '[1, 2]' could not be converted into an integer."
err = assert_raises ArgumentError do
@filter.to_integer([1, 2])
end