Add cucumber specs.

This commit is contained in:
Parker Moore 2016-04-21 16:09:23 -07:00
parent 42cc2445a5
commit d5dd423bfd
No known key found for this signature in database
GPG Key ID: 193CDEBA72063C58
4 changed files with 66 additions and 0 deletions

61
features/theme.feature Normal file
View File

@ -0,0 +1,61 @@
Feature: Writing themes
As a hacker who likes to share my expertise
I want to be able to make a gemified theme
In order to share my awesome style skillz with other Jekyllites
Scenario: A theme with SCSS
Given I have a configuration file with "theme" set to "test-theme"
And I have a css directory
And I have a "css/main.scss" page that contains "@import 'style';"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see ".sample {\n color: black; }" in "_site/css/main.css"
Scenario: A theme with an include
Given I have a configuration file with "theme" set to "test-theme"
And I have an _includes directory
And I have an "_includes/in_project.html" file that contains "I'm in the project."
And I have an "index.html" page that contains "{% include in_project.html %} {% include include.html %}"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "I'm in the project." in "_site/index.html"
And I should see "<span class=\"sample\">include.html from test-theme</span>" in "_site/index.html"
Scenario: A theme with a layout
Given I have a configuration file with "theme" set to "test-theme"
And I have an _layouts directory
And I have an "_layouts/post.html" file that contains "post.html from the project: {{ content }}"
And I have an "index.html" page with layout "default" that contains "I'm content."
And I have a "post.html" page with layout "post" that contains "I'm more content."
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "default.html from test-theme: I'm content." in "_site/index.html"
And I should see "post.html from the project: I'm more content." in "_site/post.html"
Scenario: Complicated site that puts it all together
Given I have a configuration file with "theme" set to "test-theme"
And I have a _posts directory
And I have the following posts:
| title | date | layout | content |
| entry1 | 2016-04-21 | post | I am using a local layout. {% include include.html %} |
| entry2 | 2016-04-21 | default | I am using a themed layout. {% include include.html %} {% include in_project.html %} |
And I have a _layouts directory
And I have a "_layouts/post.html" page with layout "default" that contains "I am a post layout! {{ content }}"
And I have an _includes directory
And I have an "_includes/in_project.html" file that contains "I am in the project, not the theme."
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "I am in the project, not the theme." in "_site/2016/04/21/entry2.html"
And I should see "<span class=\"sample\">include.html from test-theme</span>" in "_site/2016/04/21/entry2.html"
And I should see "default.html from test-theme:" in "_site/2016/04/21/entry2.html"
And I should see "I am using a themed layout." in "_site/2016/04/21/entry2.html"
And I should not see "I am a post layout!" in "_site/2016/04/21/entry2.html"
And I should not see "I am in the project, not the theme." in "_site/2016/04/21/entry1.html"
And I should see "<span class=\"sample\">include.html from test-theme</span>" in "_site/2016/04/21/entry1.html"
And I should see "default.html from test-theme:" in "_site/2016/04/21/entry1.html"
And I should see "I am using a local layout." in "_site/2016/04/21/entry1.html"
And I should see "I am a post layout!" in "_site/2016/04/21/entry1.html"

View File

@ -0,0 +1 @@
<span class="sample">include.html from test-theme</span>

View File

@ -0,0 +1 @@
default.html from test-theme: {{ content }}

View File

@ -0,0 +1,3 @@
.sample {
color: black;
}