feature: support toLiquid, working on #81

This commit is contained in:
harttle
2018-08-14 00:11:50 +08:00
committed by Jun Yang
parent 5b43520d78
commit 7a3689067b
5 changed files with 29 additions and 2 deletions
+8
View File
@@ -96,6 +96,14 @@ describe('scope', function () {
expect(scope.get('foo.bar')).to.equal('BAR')
})
it('should respect to toLiquid', function () {
let scope = Scope.factory({foo: {
toLiquid: () => ({bar: 'BAR'}),
bar: 'bar'
}})
expect(scope.get('foo.bar')).to.equal('BAR')
})
it('should access child property via dot syntax', function () {
expect(scope.get('bar.zoo')).to.equal('coo')
expect(scope.get('bar.arr')).to.deep.equal(['a', 'b'])