File: link_tag.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 (78 lines) | stat: -rw-r--r-- 4,375 bytes parent folder | download | duplicates (2)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Feature: Link Tag
  As a hacker who likes to write a variety of content
  I want to be able to link to pages and documents
  And render them without much hassle

  Scenario: Basic site with two pages
    Given I have an "index.md" page that contains "[About my projects]({% link about.md %})"
    And I have an "about.md" page that contains "[Home]({% link index.md %})"
    When I run jekyll build
    Then I should get a zero exit status
    And the _site directory should exist
    And I should see "<p><a href=\"/about.html\">About my projects</a></p>" in "_site/index.html"
    And I should see "<p><a href=\"/\">Home</a></p>" in "_site/about.html"

  Scenario: Basic site with custom page-permalinks
    Given I have an "index.md" page that contains "[About my projects]({% link about.md %})"
    And I have an "about.md" page with permalink "/about/" that contains "[Home]({% link index.md %})"
    When I run jekyll build
    Then I should get a zero exit status
    And the _site directory should exist
    And I should see "<p><a href=\"/about/\">About my projects</a></p>" in "_site/index.html"
    And I should see "<p><a href=\"/\">Home</a></p>" in "_site/about/index.html"

  Scenario: Basic site with custom site-wide-permalinks
    Given I have an "index.md" page that contains "[About my projects]({% link about.md %})"
    And I have an "about.md" page that contains "[Home]({% link index.md %})"
    And I have a configuration file with "permalink" set to "pretty"
    When I run jekyll build
    Then I should get a zero exit status
    And the _site directory should exist
    And I should see "<p><a href=\"/about/\">About my projects</a></p>" in "_site/index.html"
    And I should see "<p><a href=\"/\">Home</a></p>" in "_site/about/index.html"

  Scenario: Basic site with two pages and custom baseurl
    Given I have an "index.md" page that contains "[About my projects]({% link about.md %})"
    And I have an "about.md" page that contains "[Home]({% link index.md %})"
    And I have a configuration file with "baseurl" set to "/blog"
    When I run jekyll build
    Then I should get a zero exit status
    And the _site directory should exist
    And I should see "<p><a href=\"/about.html\">About my projects</a></p>" in "_site/index.html"
    And I should see "<p><a href=\"/\">Home</a></p>" in "_site/about.html"

  Scenario: Basic site with two pages and custom baseurl and permalinks
    Given I have an "index.md" page that contains "[About my projects]({% link about.md %})"
    And I have an "about.md" page that contains "[Home]({% link index.md %})"
    And I have a "_config.yml" file with content:
    """
    baseurl: /blog
    permalink: pretty
    """
    When I run jekyll build
    Then I should get a zero exit status
    And the _site directory should exist
    And I should see "<p><a href=\"/about/\">About my projects</a></p>" in "_site/index.html"
    And I should see "<p><a href=\"/\">Home</a></p>" in "_site/about/index.html"

  Scenario: Linking to a ghost file
    Given I have an "index.md" page that contains "[About my projects]({% link about.md %})"
    And I have an "about.md" page that contains "[Contact]({% link contact.md %})"
    When I run jekyll build
    Then I should get a non-zero exit status
    And the _site directory should not exist
    And I should see "Could not find document 'contact.md' in tag 'link'" in the build output

  Scenario: Complex site with a variety of files
    Given I have an "index.md" page that contains "[About my projects]({% link about.md %})"
    And I have an "about.md" page that contains "[Latest Hack]({% link _posts/2018-02-15-metaprogramming.md %})"
    And I have a _posts directory
    And I have an "_posts/2018-02-15-metaprogramming.md" page that contains "[Download This]({% link script.txt %})"
    And I have a "script.txt" file that contains "Static Alert!"
    When I run jekyll build
    Then I should get a zero exit status
    And the _site directory should exist
    And I should see "<p><a href=\"/about.html\">About my projects</a></p>" in "_site/index.html"
    And I should see "<p><a href=\"/2018/02/15/metaprogramming.html\">Latest Hack</a></p>" in "_site/about.html"
    And I should see "<p><a href=\"/script.txt\">Download This</a></p>" in "_site/2018/02/15/metaprogramming.html"
    And I should see "Static Alert!" in "_site/script.txt"