blob: 063eaa0219e536c5651d08d2183ef0ad03c49c0c (
plain) (
blame)
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
|
package spray.boilerplate
import org.specs2.mutable.Specification
class TemplateParserSpecs extends Specification {
import TemplateParser.parse
"TemplateParser.parse" should {
"without expansion" in {
parse("abc") === FixedString("abc") pendingUntilFixed
}
"just expansion" in {
parse("[# def #]") === Expand(LiteralString(" def "), ", ") pendingUntilFixed
}
"multiple expansions" in {
parse("[#a#]abc[#b#]") ===
Sequence(List(Expand(LiteralString("a"), ", "), FixedString("abc"), Expand(LiteralString("b"), ", "))) pendingUntilFixed
}
"one surrounded expansion" in {
parse("abc[#a#]def") === Sequence(List(FixedString("abc"), Expand(LiteralString("a"), ", "), FixedString("def")))
}
}
}
|