commit
cddea273a9
|
@ -205,7 +205,7 @@ module Jekyll
|
|||
input.group_by do |item|
|
||||
item_property(item, property).to_s
|
||||
end.inject([]) do |memo, i|
|
||||
memo << { "name" => i.first, "items" => i.last }
|
||||
memo << { "name" => i.first, "items" => i.last, "size" => i.last.size }
|
||||
end
|
||||
else
|
||||
input
|
||||
|
|
|
@ -289,6 +289,14 @@ class TestFilters < JekyllUnitTest
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
should "include the size of each grouping" do
|
||||
@filter.site.process
|
||||
grouping = @filter.group_by(@filter.site.pages, "layout")
|
||||
grouping.each do |g|
|
||||
assert_equal g["items"].size, g["size"], "The size property for '#{g["name"]}' doesn't match the size of the Array."
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "where filter" do
|
||||
|
|
Loading…
Reference in New Issue