Corrected error message as suggested by @parkr.
Signed-off-by: Martin Jorn Rogalla <martin@martinrogalla.com>
This commit is contained in:
parent
78af3c5018
commit
92a9582733
|
@ -223,7 +223,7 @@ module Jekyll
|
||||||
# Returns the filtered array of objects
|
# Returns the filtered array of objects
|
||||||
def sort(input, property = nil, nils = "first")
|
def sort(input, property = nil, nils = "first")
|
||||||
if input.nil?
|
if input.nil?
|
||||||
raise ArgumentError.new("Sort: cannot sort a null object.")
|
raise ArgumentError.new("Cannot sort a null object.")
|
||||||
end
|
end
|
||||||
if property.nil?
|
if property.nil?
|
||||||
input.sort
|
input.sort
|
||||||
|
|
|
@ -284,7 +284,7 @@ class TestFilters < JekyllUnitTest
|
||||||
err = assert_raises ArgumentError do
|
err = assert_raises ArgumentError do
|
||||||
@filter.sort(nil)
|
@filter.sort(nil)
|
||||||
end
|
end
|
||||||
assert_equal "Sort: cannot sort a null object.", err.message
|
assert_equal "Cannot sort a null object.", err.message
|
||||||
end
|
end
|
||||||
should "return sorted numbers" do
|
should "return sorted numbers" do
|
||||||
assert_equal [1, 2, 2.2, 3], @filter.sort([3, 2.2, 2, 1])
|
assert_equal [1, 2, 2.2, 3], @filter.sort([3, 2.2, 2, 1])
|
||||||
|
|
Loading…
Reference in New Issue