summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter van de Bruggen <pvande@gmail.com>2010-11-19 11:38:48 -0800
committerPieter van de Bruggen <pvande@gmail.com>2010-11-19 11:38:48 -0800
commit91930341442a3b9e4591d5f0546f7dec378cace4 (patch)
tree0400e694d320b22e1b29c86d4d41258fd81bf9d5
parent5058a4394a10b750d31dad432e8b27c37c86b3fb (diff)
downloadmustache-spec-91930341442a3b9e4591d5f0546f7dec378cace4.tar.gz
Untangling numeric interpolation specs.v1.0.0rc1
-rw-r--r--specs/interpolation.yml58
1 files changed, 35 insertions, 23 deletions
diff --git a/specs/interpolation.yml b/specs/interpolation.yml
index 025219a..1fa5f08 100644
--- a/specs/interpolation.yml
+++ b/specs/interpolation.yml
@@ -39,29 +39,41 @@ tests:
expected: |
These characters should not be HTML escaped: & " < >
- - name: Basic Numeric Interpolation
- desc: Numbers should interpolate seamlessly.
- data: { power: 1.21, mph: 85 }
- template: |
- We must discharge {{power}} jiggawatts at {{mph}} miles an hour!
- expected: |
- We must discharge 1.21 jiggawatts at 85 miles an hour!
-
- - name: Triple Mustache Numeric Interpolation
- desc: Numbers should interpolate seamlessly.
- data: { power: 1.21, mph: 85 }
- template: |
- We must discharge {{{power}}} jiggawatts at {{{mph}}} miles an hour!
- expected: |
- We must discharge 1.21 jiggawatts at 85 miles an hour!
-
- - name: Ampersand Numeric Interpolation
- desc: Numbers should interpolate seamlessly.
- data: { power: 1.21, mph: 85 }
- template: |
- We must discharge {{&power}} jiggawatts at {{&mph}} miles an hour!
- expected: |
- We must discharge 1.21 jiggawatts at 85 miles an hour!
+ - name: Basic Integer Interpolation
+ desc: Integers should interpolate seamlessly.
+ data: { mph: 85 }
+ template: '"{{mph}} miles an hour!"'
+ expected: '"85 miles an hour!"'
+
+ - name: Triple Mustache Integer Interpolation
+ desc: Integers should interpolate seamlessly.
+ data: { mph: 85 }
+ template: '"{{{mph}}} miles an hour!"'
+ expected: '"85 miles an hour!"'
+
+ - name: Ampersand Integer Interpolation
+ desc: Integers should interpolate seamlessly.
+ data: { mph: 85 }
+ template: '"{{&mph}} miles an hour!"'
+ expected: '"85 miles an hour!"'
+
+ - name: Basic Decimal Interpolation
+ desc: Decimals should interpolate seamlessly with proper significance.
+ data: { power: 1.210 }
+ template: '"{{power}} jiggawatts!"'
+ expected: '"1.21 jiggawatts!"'
+
+ - name: Triple Mustache Decimal Interpolation
+ desc: Decimals should interpolate seamlessly with proper significance.
+ data: { power: 1.210 }
+ template: '"{{{power}}} jiggawatts!"'
+ expected: '"1.21 jiggawatts!"'
+
+ - name: Ampersand Decimal Interpolation
+ desc: Decimals should interpolate seamlessly with proper significance.
+ data: { power: 1.210 }
+ template: '"{{&power}} jiggawatts!"'
+ expected: '"1.21 jiggawatts!"'
# Whitespace Sensitivity