Example #1
0
 assert.throws(function () {
     comb.hash.omit("hello");
 })
Example #2
0
 it.should("return a hash with the same keys if no keys are passed in to exclude", function () {
     assert.deepEqual(comb.hash.omit(obj), obj);
 });
Example #3
0
 it.should("not throw an error if a key does not exist in the object", function () {
     assert.deepEqual(comb.hash.omit(obj, ["d"]), obj);
 });
Example #4
0
 it.should("not change the original object", function () {
     comb.hash.omit(obj, ["a", "b", "c"]);
     assert.deepEqual(obj, {a: "a", b: "b", c: "c"});
 });
Example #5
0
 it.should("omit key/value pairs from a hash using a string as a key", function () {
     assert.deepEqual(comb.hash.omit(obj, "c"), {a: "a", b: "b"});
 });
Example #6
0
 it.should("omit key/value pairs from a hash using an array of keys", function () {
     assert.deepEqual(comb.hash.omit(obj, ["a", "b"]), {c: "c"});
 });