Fix RuboCop Performance offenses in test files (#7839)
* Replace select.first with find * Replace select.count with count
This commit is contained in:
parent
de6548f1ba
commit
3eab32fad7
|
@ -175,7 +175,7 @@ class TestDocument < JekyllUnitTest
|
|||
}]
|
||||
)
|
||||
@site.process
|
||||
@document = @site.collections["slides"].docs.select { |d| d.is_a?(Document) }.first
|
||||
@document = @site.collections["slides"].docs.find { |d| d.is_a?(Document) }
|
||||
end
|
||||
|
||||
should "know the front matter defaults" do
|
||||
|
|
|
@ -1036,7 +1036,7 @@ class TestFilters < JekyllUnitTest
|
|||
posts = @filter.site.site_payload["site"]["posts"]
|
||||
results = @filter.where_exp(posts, "post",
|
||||
"post.date > site.dont_show_posts_before")
|
||||
assert_equal posts.select { |p| p.date > @sample_time }.count, results.length
|
||||
assert_equal posts.count { |p| p.date > @sample_time }, results.length
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue