File: plugins.feature

package info (click to toggle)
jekyll 3.9.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,604 kB
  • sloc: ruby: 15,325; javascript: 1,455; sh: 214; xml: 29; makefile: 7
file content (37 lines) | stat: -rw-r--r-- 1,703 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Feature: Configuring and using plugins
  As a hacker
  I want to specify my own plugins that can modify Jekyll's behaviour

  Scenario: Add a gem-based plugin
    Given I have an "index.html" file that contains "Whatever"
    And I have a configuration file with "gems" set to "[jekyll_test_plugin]"
    When I run jekyll build
    Then I should get a zero exit status
    And the _site directory should exist
    And I should see "Whatever" in "_site/index.html"
    And I should see "this is a test" in "_site/test.txt"

  Scenario: Add an empty whitelist to restrict all gems
    Given I have an "index.html" file that contains "Whatever"
    And I have a configuration file with:
      | key       | value                |
      | gems      | [jekyll_test_plugin] |
      | whitelist | []                   |
    When I run jekyll build --safe
    Then I should get a zero exit status
    And the _site directory should exist
    And I should see "Whatever" in "_site/index.html"
    And the "_site/test.txt" file should not exist

  Scenario: Add a whitelist to restrict some gems but allow others
    Given I have an "index.html" file that contains "Whatever"
    And I have a configuration file with:
      | key       | value                                              |
      | gems      | [jekyll_test_plugin, jekyll_test_plugin_malicious] |
      | whitelist | [jekyll_test_plugin]                               |
    When I run jekyll build --safe
    Then I should get a zero exit status
    And the _site directory should exist
    And I should see "Whatever" in "_site/index.html"
    And the "_site/test.txt" file should exist
    And I should see "this is a test" in "_site/test.txt"