mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-20 06:50:47 -07:00
feature: variable lookup respects to to_liquid, #81
This commit is contained in:
@@ -88,6 +88,14 @@ describe('scope', function () {
|
||||
}).to.throw(/unbalanced '/)
|
||||
})
|
||||
|
||||
it('should respect to to_liquid', function () {
|
||||
let scope = Scope.factory({foo: {
|
||||
to_liquid: () => ({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'])
|
||||
|
||||
Reference in New Issue
Block a user