summaryrefslogtreecommitdiff
path: root/specs/~lambdas.json
blob: f9706bed44d57808d323b391bcffbb60a56a0314 (plain)
1
{"tests":[{"name":"Interpolation","data":{"lambda":"#<YAML::DomainType:0x1017cae28>"},"expected":"Hello, world!","template":"Hello, {{lambda}}!","desc":"A lambda's return value should be interpolated."},{"name":"Interpolation - Expansion","data":{"planet":"world","lambda":"#<YAML::DomainType:0x1017ca388>"},"expected":"Hello, world!","template":"Hello, {{lambda}}!","desc":"A lambda's return value should be parsed."},{"name":"Interpolation - Multiple Calls","data":{"lambda":"#<YAML::DomainType:0x1017c96e0>"},"expected":"1 == 1 == 1","template":"{{lambda}} == {{{lambda}}} == {{lambda}}","desc":"Interpolated lambdas should only be called once."},{"name":"Interpolation - Caches","data":{"context":{"lambda":"#<YAML::DomainType:0x1017c8998>","key":"Under"},"key":"Top"},"expected":"Under the Big Top","template":"{{#context}}{{key}} the {{lambda}}{{/context}} {{key}}","desc":"Lambda caches should not disrupt normal context operations."},{"name":"Escaping","data":{"lambda":"#<YAML::DomainType:0x1017c7b88>"},"expected":"<&gt;>","template":"<{{lambda}}{{{lambda}}}","desc":"Lambda results should be appropriately escaped."},{"name":"Section","data":{"x":"Error!","lambda":"#<YAML::DomainType:0x1017c70e8>"},"expected":"<yes>","template":"<{{#lambda}}{{x}}{{/lambda}}>","desc":"Lambdas used for sections should receive the raw section string."},{"name":"Section - Expansion","data":{"planet":"Earth","lambda":"#<YAML::DomainType:0x1017c6260>"},"expected":"<-Earth->","template":"<{{#lambda}}-{{/lambda}}>","desc":"Lambdas used for sections should have their results parsed."},{"name":"Section - Multiple Calls","data":{"lambda":"#<YAML::DomainType:0x1017c5658>"},"expected":"__FILE__ != __LINE__","template":"{{#lambda}}FILE{{/lambda}} != {{#lambda}}LINE{{/lambda}}","desc":"Lambdas used for sections should not simply cache the first response."},{"name":"Inverted Section","data":{"static":"static","lambda":"#<YAML::DomainType:0x1017c4c58>"},"expected":"<>","template":"<{{^lambda}}{{static}}{{/lambda}}>","desc":"Lambdas used for inverted sections should be considered truthy."}]}