Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Assertion.prototype properties configurable #14

Merged
merged 1 commit into from
Feb 12, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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