mirror of
https://github.com/chaijs/chai
synced 2024-11-15 00:07:11 +00:00
Rename change related assertions obj argument to target
This commit is contained in:
parent
a9b070623e
commit
877acb52dd
1 changed files with 21 additions and 21 deletions
|
@ -1634,30 +1634,30 @@ module.exports = function (chai, _) {
|
|||
* @name change
|
||||
* @alias changes
|
||||
* @alias Change
|
||||
* @param {String} object
|
||||
* @param {String} target
|
||||
* @param {String} property name _optional_
|
||||
* @param {String} message _optional_
|
||||
* @namespace BDD
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function assertChanges (object, prop, msg) {
|
||||
function assertChanges (target, prop, msg) {
|
||||
if (msg) flag(this, 'message', msg);
|
||||
var fn = flag(this, 'object');
|
||||
new Assertion(fn).is.a('function');
|
||||
|
||||
var initial;
|
||||
if (!prop) {
|
||||
new Assertion(object).is.a('function');
|
||||
initial = object();
|
||||
new Assertion(target).is.a('function');
|
||||
initial = target();
|
||||
} else {
|
||||
new Assertion(object, msg).to.have.property(prop);
|
||||
initial = object[prop];
|
||||
new Assertion(target, msg).to.have.property(prop);
|
||||
initial = target[prop];
|
||||
}
|
||||
|
||||
fn();
|
||||
|
||||
var final = prop === undefined ? object() : object[prop];
|
||||
var final = prop === undefined ? target() : target[prop];
|
||||
var msgObj = prop === undefined ? initial : '.' + prop;
|
||||
|
||||
this.assert(
|
||||
|
@ -1682,30 +1682,30 @@ module.exports = function (chai, _) {
|
|||
* @name increase
|
||||
* @alias increases
|
||||
* @alias Increase
|
||||
* @param {String} object
|
||||
* @param {String} target
|
||||
* @param {String} property name
|
||||
* @param {String} message _optional_
|
||||
* @namespace BDD
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function assertIncreases (object, prop, msg) {
|
||||
function assertIncreases (target, prop, msg) {
|
||||
if (msg) flag(this, 'message', msg);
|
||||
var fn = flag(this, 'object');
|
||||
new Assertion(fn).is.a('function');
|
||||
|
||||
var initial;
|
||||
if (!prop) {
|
||||
new Assertion(object).is.a('function');
|
||||
initial = object();
|
||||
new Assertion(target).is.a('function');
|
||||
initial = target();
|
||||
} else {
|
||||
new Assertion(object, msg).to.have.property(prop);
|
||||
initial = object[prop];
|
||||
new Assertion(target, msg).to.have.property(prop);
|
||||
initial = target[prop];
|
||||
}
|
||||
|
||||
fn();
|
||||
|
||||
var final = prop === undefined ? object() : object[prop];
|
||||
var final = prop === undefined ? target() : target[prop];
|
||||
var msgObj = prop === undefined ? initial : '.' + prop;
|
||||
|
||||
this.assert(
|
||||
|
@ -1730,30 +1730,30 @@ module.exports = function (chai, _) {
|
|||
* @name decrease
|
||||
* @alias decreases
|
||||
* @alias Decrease
|
||||
* @param {String} object
|
||||
* @param {String} target
|
||||
* @param {String} property name
|
||||
* @param {String} message _optional_
|
||||
* @namespace BDD
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function assertDecreases (object, prop, msg) {
|
||||
function assertDecreases (target, prop, msg) {
|
||||
if (msg) flag(this, 'message', msg);
|
||||
var fn = flag(this, 'object');
|
||||
new Assertion(fn).is.a('function');
|
||||
|
||||
var initial;
|
||||
if (!prop) {
|
||||
new Assertion(object).is.a('function');
|
||||
initial = object();
|
||||
new Assertion(target).is.a('function');
|
||||
initial = target();
|
||||
} else {
|
||||
new Assertion(object, msg).to.have.property(prop);
|
||||
initial = object[prop];
|
||||
new Assertion(target, msg).to.have.property(prop);
|
||||
initial = target[prop];
|
||||
}
|
||||
|
||||
fn();
|
||||
|
||||
var final = prop === undefined ? object() : object[prop];
|
||||
var final = prop === undefined ? target() : target[prop];
|
||||
var msgObj = prop === undefined ? initial : '.' + prop;
|
||||
|
||||
this.assert(
|
||||
|
|
Loading…
Reference in a new issue