chai = require 'chai'
assert = chai.assert
expect = chai.expect
should = chai.should()
Tumbler = require('../lib/tumble')
tumbl = new Tumbler()
test_data = [
{
'input': '',
'output': ''
}
{
'input': '',
'output': '',
}
{
'input': '
{name}
'
'output': 'Elf Sternberg
'
'data': {'name': 'Elf Sternberg'}
}
{
'input': '{title} {name}
'
'output': 'Mr. Elf Sternberg
'
'data': {'name': 'Elf Sternberg', 'title': 'Mr.'}
}
{
'input': '{block:Stories}{Title}{/block:Stories}'
'output': ''
'data': {'stories': [{'title': 'AAA'}, {'title': 'BBB'}]}
}]
describe "Basic Functionality", ->
for data in test_data
it "should work with #{data.description}", ->
tumbl.parse(data.input)(data.data).should.equal data.output