'use babel'

import {Builder, Template} from '../src/main'

describe('String Templates', function() {

  describe('Template', function() {
    it('supports normal gets', function() {
      const template = new Template()
      expect(template.render('Hey {some}', {some: 'Thing'})).toBe('Hey Thing')
    })

    it('supports deep gets', function() {
      const template = new Template()
      expect(template.render('Hey {come.on}', {come: {on: 'There'}})).toBe('Hey There')
      expect(template.render('Hey {come.on} {first.second.third.forth}', {
        come: {on: 'There'},
        first: {second: {third: {forth: 'fifth'}}}
      })).toBe('Hey There fifth')
    })
  })

})

@@ -664,16 +664,620 @@
 )%0A    %7D)
+%0A%0A    it('replaces keeps non-found as is', function() %7B%0A      const template = new Template()%0A      expect(template.render('Hey %7Bcome.on%7D', %7B%7D)).toBe('Hey %7Bcome.on%7D')%0A    %7D)%0A%0A    it('supports substrings', function() %7B%0A      const template = new Template()%0A      expect(template.render('Hey %7Bcome.on:1%7D', %7Bcome: %7Bon: 'Wow'%7D%7D)).toBe('Hey ow')%0A      expect(template.render('Hey %7Bcome.on:1:2%7D', %7Bcome: %7Bon: 'Wow'%7D%7D)).toBe('Hey o')%0A      expect(template.render('Hey %7Bcome.on:1:3%7D', %7Bcome: %7Bon: 'Wow'%7D%7D)).toBe('Hey ow')%0A      expect(template.render('Hey %7Bcome.on:2%7D', %7Bcome: %7Bon: 'Wow'%7D%7D)).toBe('Hey w')%0A    %7D)
 %0A  %7D)%0A%0A%7D

Add specs for substr