describe('dJSON', function () {
  'use strict';

  var chai = require('chai');
  var expect = chai.expect;

  var dJSON = require('../lib/dJSON');

  var path = 'x.y["q.{r}"].z';
  var obj;
  beforeEach(function () {
    obj = {
      x: {
        y: {
          'q.{r}': {
            z: 635
          },
          q: {
            r: {
              z: 1
            }
          }
        }
      },
      'x-y': 5
    };
  });
  it('gets a value from an object with a path containing properties which contain a period', function () {
    expect(dJSON.get(obj, path)).to.equal(635);
    expect(dJSON.get(obj, 'x.y.q.r.z')).to.equal(1);
  });

  it('sets a value from an object with a path containing properties which contain a period', function () {
    dJSON.set(obj, path, 17771);
    expect(dJSON.get(obj, path)).to.equal(17771);
    expect(dJSON.get(obj, 'x.y.q.r.z')).to.equal(1);
  });

  it('does not create an object when a path exists as empty string', function () {
    var newObj = {
      nestedObject: {
        anArray: [
          'i have a value',
          ''
        ]
      }
    };
    var newPath = 'nestedObject.anArray[1]';

    dJSON.set(newObj, newPath, 17771);
    expect(newObj).to.deep.equal({
      nestedObject: {
        anArray: [
          'i have a value',
          17771
        ]
      }
    });
  });

  it('creates an object from a path with a left curly brace', function () {
    var newObj = {};

    dJSON.set(newObj, path.replace('}', ''), 'foo');
    expect(newObj).to.be.deep.equal({
      x: {
        y: {
          'q.{r': {
            z: 'foo'
          }
        }
      }
    });
  });
  it('creates an object from a path with a right curly brace', function () {
    var newObj = {};

    dJSON.set(newObj, path.replace('{', ''), 'foo');
    expect(newObj).to.be.deep.equal({
      x: {
        y: {
          'q.r}': {
            z: 'foo'
          }
        }
      }
    });
  });
  it('creates an object from a path with curly braces', function () {
    var newObj = {};

    dJSON.set(newObj, path, 'foo');
    expect(newObj).to.be.deep.equal({
      x: {
        y: {
          'q.{r}': {
            z: 'foo'
          }
        }
      }
    });
  });
  it('creates an object from a path without curly braces', function () {
    var newObj = {};

    dJSON.set(newObj, path.replace('{', '').replace('}', ''), 'foo');
    expect(newObj).to.be.deep.equal({
      x: {
        y: {
          'q.r': {
            z: 'foo'
          }
        }
      }
    });
  });
});

@@ -884,24 +884,349 @@
 (1);%0A  %7D);%0A%0A
+  it('will return undefined when requesting a property with a dash directly', function () %7B%0A    expect(dJSON.get(obj, 'x-y')).to.be.undefined;%0A  %7D);%0A%0A  it('will return the proper value when requesting a property with a dash by square bracket notation', function () %7B%0A    expect(dJSON.get(obj, '%5B%22x-y%22%5D')).to.equal(5);%0A  %7D);%0A%0A
   it('does n

Add test-cases for properties with a dash