Skip to content

Commit

Permalink
Add block indentation specs (mustache#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed Jul 13, 2021
1 parent bb63070 commit 2ad6e3e
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions specs/~inheritance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,72 @@ tests:
partials:
parent: "{{$foo}}default content{{/foo}}"
expected: default content

- name: Standalone parent
desc: A parent's opening and closing tags need not be on separate lines in order to be standalone
data: {}
template: |
Hi,
{{<parent}}{{/parent}}
partials:
parent: |
one
two
expected: |
Hi,
one
two
- name: Standalone block
desc: A block's opening and closing tags need not be on separate lines in order to be standalone
data: {}
template: |
{{<parent}}{{$block}}
one
two{{/block}}
{{/parent}}
partials:
parent: |
Hi,
{{$block}}{{/block}}
expected: |
Hi,
one
two
- name: Block reindentation
desc: Block indentation is removed at the site of definition and added at the site of expansion
data: {}
template: |
{{<parent}}{{$block}}
one
two
{{/block}}{{/parent}}
partials:
parent: |
Hi,
{{$block}}
{{/block}}
expected: |
Hi,
one
two
- name: Intrinsic indentation
desc: When the block opening tag is standalone, indentation is determined by default content
data: {}
template: |
{{<parent}}{{$block}}
one
two
{{/block}}{{/parent}}
partials:
parent: |
Hi,
{{$block}}
default
{{/block}}
expected: |
Hi,
one
two

0 comments on commit 2ad6e3e

Please sign in to comment.