Add cucumber feature for layouts inside subfolders
This commit is contained in:
parent
87ef39aeb0
commit
e141dfa03f
|
@ -44,6 +44,17 @@ Feature: Create sites
|
|||
Then the _site directory should exist
|
||||
And I should see "Post Layout: <p>The only winning move is not to play.</p>" in "_site/2009/03/27/wargames.html"
|
||||
|
||||
Scenario: Basic site with layout inside a subfolder and a post
|
||||
Given I have a _layouts directory
|
||||
And I have a _posts directory
|
||||
And I have the following posts:
|
||||
| title | date | layout | content |
|
||||
| Wargames | 2009-03-27 | post/simple | The only winning move is not to play. |
|
||||
And I have a post/simple layout that contains "Post Layout: {{ content }}"
|
||||
When I run jekyll
|
||||
Then the _site directory should exist
|
||||
And I should see "Post Layout: <p>The only winning move is not to play.</p>" in "_site/2009/03/27/wargames.html"
|
||||
|
||||
Scenario: Basic site with layouts, pages, posts and files
|
||||
Given I have a _layouts directory
|
||||
And I have a page layout that contains "Page {{ page.title }}: {{ content }}"
|
||||
|
|
|
@ -38,7 +38,12 @@ Given /^I have an? (.*) (layout|theme) that contains "(.*)"$/ do |name, type, te
|
|||
else
|
||||
'_theme'
|
||||
end
|
||||
File.open(File.join(folder, name + '.html'), 'w') do |f|
|
||||
destination_file = File.join(folder, name + '.html')
|
||||
destination_path = File.dirname(destination_file)
|
||||
unless File.exist?(destination_path)
|
||||
FileUtils.mkdir_p(destination_path)
|
||||
end
|
||||
File.open(destination_file, 'w') do |f|
|
||||
f.write(text)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue