blob: a0ff0494b6d700c2ab39d87b8b30e76018cc14a6 (
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
|
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")
}
"just expansion" in {
parse("[# def #]") === Expand(LiteralString(" def "), ", ")
}
"multiple expansions" in {
parse("[#a#]abc[#b#]") ===
Sequence(List(Expand(LiteralString("a"), ", "), FixedString("abc"), Expand(LiteralString("b"), ", ")))
}
"one surrounded expansion" in {
parse("abc[#a#]def") === Sequence(List(FixedString("abc"), Expand(LiteralString("a"), ", "), FixedString("def")))
}
}
}
|