From 8e939cd86e67b81ecc97108684928b4ca553dd4c Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 18 May 2016 09:58:20 -0700 Subject: [PATCH] Add failing test for layout data inheritance bug (#4433) --- features/layout_data.feature | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/features/layout_data.feature b/features/layout_data.feature index 8f085777..c2af5b70 100644 --- a/features/layout_data.feature +++ b/features/layout_data.feature @@ -36,17 +36,21 @@ Feature: Layout data Then the "_site/index.html" file should exist 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 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: """ --- layout: default foo: my special data + bar: im special --- {{ content }} """ @@ -54,6 +58,7 @@ Feature: Layout data """ --- layout: default + bar: im page --- {{ content }} """ @@ -61,5 +66,5 @@ Feature: Layout data And I have an "jekyll.html" page with layout "page" that contains "page content" When I run jekyll build 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: ''" in "_site/jekyll.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: '' bar: 'im page'" in "_site/jekyll.html"