Add failing test for layout data inheritance bug (#4433)

This commit is contained in:
Parker Moore 2016-05-18 09:58:20 -07:00 committed by Pat Hawks
parent a99adcafaa
commit 8e939cd86e
1 changed files with 9 additions and 4 deletions

View File

@ -36,17 +36,21 @@ Feature: Layout data
Then the "_site/index.html" file should exist Then the "_site/index.html" file should exist
And I should see "page content\n foo: my custom data" in "_site/index.html" And I should see "page content\n foo: my custom data" in "_site/index.html"
Scenario: Inherit custom layout data Scenario: Inherit custom layout data and clear when not present
Given I have a _layouts directory Given I have a _layouts directory
And I have a "_layouts/default.html" file with content: And I have a "_layouts/default.html" file with content:
""" """
{{ content }} foo: '{{ layout.foo }}' ---
bar: i'm default
---
{{ content }} foo: '{{ layout.foo }}' bar: '{{ layout.bar }}'
""" """
And I have a "_layouts/special.html" file with content: And I have a "_layouts/special.html" file with content:
""" """
--- ---
layout: default layout: default
foo: my special data foo: my special data
bar: im special
--- ---
{{ content }} {{ content }}
""" """
@ -54,6 +58,7 @@ Feature: Layout data
""" """
--- ---
layout: default layout: default
bar: im page
--- ---
{{ content }} {{ content }}
""" """
@ -61,5 +66,5 @@ Feature: Layout data
And I have an "jekyll.html" page with layout "page" that contains "page content" And I have an "jekyll.html" page with layout "page" that contains "page content"
When I run jekyll build When I run jekyll build
Then the "_site/index.html" file should exist Then the "_site/index.html" file should exist
And I should see "page content\n foo: 'my special data'" in "_site/index.html" And I should see "page content\n foo: 'my special data' bar: 'im special'" in "_site/index.html"
And I should see "page content\n foo: ''" in "_site/jekyll.html" And I should see "page content\n foo: '' bar: 'im page'" in "_site/jekyll.html"