Sha256: d3eec25dbb8454239b7def394cfd165d00c9f6b2be4141518c253bd4fc5d53cf

Contents?: true

Size: 1.24 KB

Versions: 8

Compression:

Stored size: 1.24 KB

Contents

describe 'uki.theme.Template'
    it 'should replace single value'
        var t = new uki.theme.Template('<code>${value}</code>')
        t.render({value: '111'}).should.be '<code>111</code>'
    end
    
    it 'should replace at the beggining of a string'
        var t = new uki.theme.Template('${before}<code>${value}</code>')
        t.render({before: '000', value: '111'}).should.be '000<code>111</code>'
    end
    
    it 'should replace at the end of a string'
        var t = new uki.theme.Template('<code>${value}</code>${after}')
        t.render({value: '111', after: '222'}).should.be '<code>111</code>222'
    end
    
    it 'should replace several same values'
        var t = new uki.theme.Template('<code>${value} ${value}</code>');
        t.render({value: '111'}).should.be '<code>111 111</code>'
    end
    
    it 'should replace adjacent values'
        var t = new uki.theme.Template('<code>${a}${b}</code>');
        t.render({a: '111', b: '222'}).should.be '<code>111222</code>'
    end
    
    it 'should work with brackets'
        var t = new uki.theme.Template('<code>${a} {something} ${b} .css { some code }</code>');
        t.render({a: '111', b: '222'}).should.be '<code>111 {something} 222 .css { some code }</code>'
    end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
uki-1.1.4 frameworks/uki/spec/unit/theme/template.spec.js
uki-1.1.3 frameworks/uki/spec/unit/theme/template.spec.js
uki-1.1.2 frameworks/uki/spec/unit/theme/template.spec.js
uki-1.1.1 frameworks/uki/spec/unit/theme/template.spec.js
uki-1.1.0 frameworks/uki/spec/unit/theme/template.spec.js
uki-1.0.2 frameworks/uki/spec/unit/theme/template.spec.js
uki-1.0.1 frameworks/uki/spec/unit/theme/template.spec.js
uki-1.0.0 frameworks/uki/spec/unit/theme/template.spec.js