From d1f4d874be4d822ba9c68491bb26a8b7cc3df93d Mon Sep 17 00:00:00 2001 From: Nathan Hazout Date: Wed, 15 Jun 2016 11:21:02 +0300 Subject: [PATCH] Added a scenario for #4414 --- features/hooks.feature | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/features/hooks.feature b/features/hooks.feature index 48b2884e..075f632a 100644 --- a/features/hooks.feature +++ b/features/hooks.feature @@ -333,3 +333,28 @@ Feature: Hooks Then I should get a zero exit status And the _site directory should exist And I should see "Wrote document 0" in "_site/document-build.log" + + Scenario: Set a custom payload['page'] property + Given I have a _plugins directory + And I have a "_plugins/ext.rb" file with content: + """ + Jekyll::Hooks.register :pages, :pre_render do |page, payload| + payload['page']['foo'] = "hello world" + end + """ + And I have a _layouts directory + And I have a "_layouts/custom.html" file with content: + """ + --- + --- + {{ content }} {% include foo.html %} + """ + And I have a _includes directory + And I have a "_includes/foo.html" file with content: + """ + {{page.foo}} + """ + And I have an "index.html" page with layout "custom" that contains "page content" + When I run jekyll build + Then the "_site/index.html" file should exist + And I should see "page content\n hello world" in "_site/index.html"