Write test for site.documents.
This commit is contained in:
parent
fc98f06ed7
commit
3755437d08
|
@ -70,3 +70,15 @@ Feature: Collections
|
|||
When I run jekyll build
|
||||
Then the _site directory should exist
|
||||
And I should see "Collections: _methods/configuration.md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"
|
||||
|
||||
Scenario: All the documents
|
||||
Given I have an "index.html" page that contains "All documents: {% for doc in site.documents %}{{ doc.relative_path }} {% endfor %}"
|
||||
And I have fixture collections
|
||||
And I have a "_config.yml" file with content:
|
||||
"""
|
||||
collections:
|
||||
- methods
|
||||
"""
|
||||
When I run jekyll build
|
||||
Then the _site directory should exist
|
||||
And I should see "All documents: _methods/configuration.md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"
|
||||
|
|
|
@ -413,7 +413,7 @@ module Jekyll
|
|||
def documents
|
||||
collections.reduce(Set.new) do |docs, (_, collection)|
|
||||
docs.merge(collection.docs)
|
||||
end
|
||||
end.to_a
|
||||
end
|
||||
|
||||
def each_site_file
|
||||
|
|
Loading…
Reference in New Issue