function assertOwnPropertyDescriptor (name, descriptor, msg) {
    if (typeof descriptor === 'string') {
      msg = descriptor;
      descriptor = null;
    }
    if (msg) flag(this, 'message', msg);
    var obj = flag(this, 'object');
    var actualDescriptor = Object.getOwnPropertyDescriptor(Object(obj), name);
    if (actualDescriptor && descriptor) {
      this.assert(
          _.eql(descriptor, actualDescriptor)
        , 'expected the own property descriptor for ' + _.inspect(name) + ' on #{this} to match ' + _.inspect(descriptor) + ', got ' + _.inspect(actualDescriptor)
        , 'expected the own property descriptor for ' + _.inspect(name) + ' on #{this} to not match ' + _.inspect(descriptor)
        , descriptor
        , actualDescriptor
        , true
      );
    } else {
      this.assert(
          actualDescriptor
        , 'expected #{this} to have an own property descriptor for ' + _.inspect(name)
        , 'expected #{this} to not have an own property descriptor for ' + _.inspect(name)
      );
    }
    flag(this, 'object', actualDescriptor);
  }
### .ownPropertyDescriptor(name[, descriptor[, msg]])

Asserts that the target has its own property descriptor with the given key
`name`. Enumerable and non-enumerable properties are included in the
search.

    expect({a: 1}).to.have.ownPropertyDescriptor('a');

When `descriptor` is provided, `.ownPropertyDescriptor` also asserts that
the property's descriptor is deeply equal to the given `descriptor`. See
the `deep-eql` project page for info on the deep equality algorithm:
https://github.com/chaijs/deep-eql.

    expect({a: 1}).to.have.ownPropertyDescriptor('a', {
      configurable: true,
      enumerable: true,
      writable: true,
      value: 1,
    });

Add `.not` earlier in the chain to negate `.ownPropertyDescriptor`.

    expect({a: 1}).to.not.have.ownPropertyDescriptor('b');

However, it's dangerous to negate `.ownPropertyDescriptor` when providing
a `descriptor`. The problem is that it creates uncertain expectations by
asserting that the target either doesn't have a property descriptor with
the given key `name`, or that it does have a property descriptor with the
given key `name` but its not deeply equal to the given `descriptor`. It's
often best to identify the exact output that's expected, and then write an
assertion that only accepts that exact output.

When the target isn't expected to have a property descriptor with the given
key `name`, it's often best to assert exactly that.

    // Recommended
    expect({b: 2}).to.not.have.ownPropertyDescriptor('a');

    // Not recommended
    expect({b: 2}).to.not.have.ownPropertyDescriptor('a', {
      configurable: true,
      enumerable: true,
      writable: true,
      value: 1,
    });

When the target is expected to have a property descriptor with the given
key `name`, it's often best to assert that the property has its expected
descriptor, rather than asserting that it doesn't have one of many
unexpected descriptors.

    // Recommended
    expect({a: 3}).to.have.ownPropertyDescriptor('a', {
      configurable: true,
      enumerable: true,
      writable: true,
      value: 3,
    });

    // Not recommended
    expect({a: 3}).to.not.have.ownPropertyDescriptor('a', {
      configurable: true,
      enumerable: true,
      writable: true,
      value: 1,
    });

`.ownPropertyDescriptor` changes the target of any assertions that follow
in the chain to be the value of the property descriptor from the original
target object.

    expect({a: 1}).to.have.ownPropertyDescriptor('a')
      .that.has.property('enumerable', true);

`.ownPropertyDescriptor` accepts an optional `msg` argument which is a
custom error message to show when the assertion fails. The message can also
be given as the second argument to `expect`. When not providing
`descriptor`, only use the second form.

    // Recommended
    expect({a: 1}).to.have.ownPropertyDescriptor('a', {
      configurable: true,
      enumerable: true,
      writable: true,
      value: 2,
    }, 'nooo why fail??');

    // Recommended
    expect({a: 1}, 'nooo why fail??').to.have.ownPropertyDescriptor('a', {
      configurable: true,
      enumerable: true,
      writable: true,
      value: 2,
    });

    // Recommended
    expect({a: 1}, 'nooo why fail??').to.have.ownPropertyDescriptor('b');

    // Not recommended
    expect({a: 1})
      .to.have.ownPropertyDescriptor('b', undefined, 'nooo why fail??');

The above assertion isn't the same thing as not providing `descriptor`.
Instead, it's asserting that the target object has a `b` property
descriptor that's deeply equal to `undefined`.

The alias `.haveOwnPropertyDescriptor` can be used interchangeably with
`.ownPropertyDescriptor`.

@name ownPropertyDescriptor
@alias haveOwnPropertyDescriptor
@param {String} name
@param {Object} descriptor _optional_
@param {String} msg _optional_
@namespace BDD
@api public