Skip to content

Commit

Permalink
Merge pull request #14 from jfirebaugh/configurable_properties
Browse files Browse the repository at this point in the history
Make Assertion.prototype properties configurable
  • Loading branch information
logicalparadox committed Feb 12, 2012
2 parents f35cab9 + 1c6f9a0 commit 5a18f7b
Showing 1 changed file with 34 additions and 17 deletions.
51 changes: 34 additions & 17 deletions lib/assertion.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ Assertion.prototype.assert = function (expr, msg, negateMsg) {
Object.defineProperty(Assertion.prototype, 'inspect',
{ get: function () {
return inspect(this.obj);
}
},
configurable: true
});

/**
Expand All @@ -113,7 +114,8 @@ Object.defineProperty(Assertion.prototype, 'inspect',
Object.defineProperty(Assertion.prototype, 'to',
{ get: function () {
return this;
}
},
configurable: true
});

/**
Expand All @@ -128,7 +130,8 @@ Object.defineProperty(Assertion.prototype, 'to',
Object.defineProperty(Assertion.prototype, 'be',
{ get: function () {
return this;
}
},
configurable: true
});

/**
Expand All @@ -145,7 +148,8 @@ Object.defineProperty(Assertion.prototype, 'been',
{ get: function () {
this.tense = 'past';
return this;
}
},
configurable: true
});

/**
Expand All @@ -160,7 +164,8 @@ Object.defineProperty(Assertion.prototype, 'been',
Object.defineProperty(Assertion.prototype, 'an',
{ get: function () {
return this;
}
},
configurable: true
});
/**
* # is
Expand All @@ -174,7 +179,8 @@ Object.defineProperty(Assertion.prototype, 'an',
Object.defineProperty(Assertion.prototype, 'is',
{ get: function () {
return this;
}
},
configurable: true
});

/**
Expand All @@ -189,7 +195,8 @@ Object.defineProperty(Assertion.prototype, 'is',
Object.defineProperty(Assertion.prototype, 'and',
{ get: function () {
return this;
}
},
configurable: true
});

/**
Expand All @@ -204,7 +211,8 @@ Object.defineProperty(Assertion.prototype, 'and',
Object.defineProperty(Assertion.prototype, 'have',
{ get: function () {
return this;
}
},
configurable: true
});

/**
Expand All @@ -219,7 +227,8 @@ Object.defineProperty(Assertion.prototype, 'have',
Object.defineProperty(Assertion.prototype, 'with',
{ get: function () {
return this;
}
},
configurable: true
});

/**
Expand All @@ -235,7 +244,8 @@ Object.defineProperty(Assertion.prototype, 'not',
{ get: function () {
this.negate = true;
return this;
}
},
configurable: true
});

/**
Expand All @@ -260,7 +270,8 @@ Object.defineProperty(Assertion.prototype, 'ok',
, 'expected ' + this.inspect + ' to be falsey');

return this;
}
},
configurable: true
});

/**
Expand All @@ -280,7 +291,8 @@ Object.defineProperty(Assertion.prototype, 'true',
, 'expected ' + this.inspect + ' to be false');

return this;
}
},
configurable: true
});

/**
Expand All @@ -300,7 +312,8 @@ Object.defineProperty(Assertion.prototype, 'false',
, 'expected ' + this.inspect + ' to be true');

return this;
}
},
configurable: true
});

/**
Expand All @@ -325,7 +338,8 @@ Object.defineProperty(Assertion.prototype, 'exist',
, 'expected ' + this.inspect + ' to not exist');

return this;
}
},
configurable: true
});

/**
Expand All @@ -349,7 +363,8 @@ Object.defineProperty(Assertion.prototype, 'empty',
, 'expected ' + this.inspect + ' not to be empty');

return this;
}
},
configurable: true
});

/**
Expand All @@ -373,7 +388,8 @@ Object.defineProperty(Assertion.prototype, 'arguments',
, 'expected ' + this.inspect + ' to not be arguments');

return this;
}
},
configurable: true
});

/**
Expand Down Expand Up @@ -698,7 +714,8 @@ Object.defineProperty(Assertion.prototype, 'contain',
{ get: function () {
this.contains = true;
return this;
}
},
configurable: true
});

/**
Expand Down

0 comments on commit 5a18f7b

Please sign in to comment.