Feature: Doctest examples
Scenario: plain text
Given a file named "doctest.dryml" with:
"""
hi
"""
When I render "doctest.dryml"
Then the output DOM should be:
"""
hi
"""
Scenario: single ERB output tag
Given a file named "doctest.dryml" with:
"""
<%= this %>
"""
And the local variable "this" has the value "hello"
When I render "doctest.dryml"
Then the output DOM should be:
"""
hello
"""
Scenario: if-else
Given a file named "doctest.dryml" with:
"""
Hi
Bye
"""
When I render "doctest.dryml"
Then the output DOM should be:
"""
Hi
"""
Scenario: repeating tags
Given a file named "doctest.dryml" with:
"""
<%= this %>
"""
When I render "doctest.dryml"
Then the output DOM should be:
"""
1
2
3
"""
Scenario: defining a tag with a default parameter
Given a file named "doctest.dryml" with:
"""
Hi
"""
When I render "doctest.dryml"
Then the output DOM should be:
"""
Hi
"""
Scenario: calling a tag using call-tag
Given a file named "doctest.dryml" with:
"""
Hi
"""
When I render "doctest.dryml"
Then the output DOM should be:
"""
Hi
"""
Scenario: wrapping content with a custom tag
Given a file named "doctest.dryml" with:
"""
img
"""
When I render "doctest.dryml"
Then the output DOM should be:
"""
img
"""
Scenario: extending a tag (fails)
Given a file named "doctest_taglib.dryml" with:
"""
"""
And a file named "doctest_extend.dryml" with:
"""
Hello
"""
And a file named "doctest.dryml" with:
"""
New World
"""
When I include the taglib "doctest_taglib"
And I include the taglib "doctest_extend"
When I render "doctest.dryml"
Then the output DOM should be:
"""
Hello New World
"""
Scenario: extending a tag with a non-default param (fails)
Given a file named "doctest_taglib.dryml" with:
"""
"""
And a file named "doctest_extend.dryml" with:
"""
Hello
"""
And a file named "doctest.dryml" with:
"""
New World
"""
When I include the taglib "doctest_taglib"
And I include the taglib "doctest_extend"
When I render "doctest.dryml"
Then the output DOM should be:
"""
Hello New World
"""
Scenario: param-content-restore from an output context
Given a file named "doctest_taglib.dryml" with:
"""
World
"""
And a file named "doctest.dryml" with:
"""
Hello
"""
When I include the taglib "doctest_taglib"
When I render "doctest.dryml"
Then the output DOM should be:
"""
Hello World
"""