var assert = require('assert'),
  utils = require('../lib/utils');

describe('utils', function () {
  describe('nestedGet', function () {
    it('should properly return a nested property', function () {
      var obj = {
        a: {
          b: {
            c: 'something'
          }
        }
      };
      var key = 'a.b.c';
      var value = 'something';

      assert.equal(utils.nestedGet(obj, key), value);
    });
  });

  describe('compileKey', function () {
    it('should properly compile a key template from context', function () {
      var obj = {
        lang: 'JavaScript',
        framework: 'Angular'
      };
      var template = 'my favorite language is :lang, and my favorite framework is :framework';

      assert.equal(utils.compileKey(template, obj), 
        'my favorite language is ' + obj.lang + ', and my favorite framework is ' + obj.framework);
    });
  });
});

@@ -877,23 +877,322 @@
 rk);%0A    %7D);
+%0A%0A    it('should undefined for missing context keys', function () %7B%0A      var obj = %7B%0A        a: 'something'%0A      %7D;%0A      var template = ':a is something, but :b is nothing';%0A%0A      assert.equal(utils.compileKey(template, obj), %0A        'something is something, but undefined is nothing');%0A    %7D);
 %0A  %7D);%0A%7D);%0A

add test for utils.compileKey