Comparing version 0.1.6 to 0.1.7
17
chai.js
@@ -556,2 +556,3 @@ !function (name, definition) { | ||
* @param {Constructor} | ||
* @alias instanceOf | ||
* @api public | ||
@@ -936,3 +937,5 @@ */ | ||
('below', 'lessThan') | ||
('throw', 'throws'); | ||
('throw', 'throws') | ||
('instanceof', 'instanceOf'); | ||
}); // module: assertion.js | ||
@@ -949,3 +952,3 @@ | ||
exports.version = '0.1.6'; | ||
exports.version = '0.1.7'; | ||
@@ -969,2 +972,3 @@ exports.expect = require('./interface/expect'); | ||
}; | ||
}); // module: chai.js | ||
@@ -1316,3 +1320,3 @@ | ||
assert.isObject = function (val, msg) { | ||
new Assertion(val, msg).to.be.an('object'); | ||
new Assertion(val, msg).to.be.a('object'); | ||
}; | ||
@@ -1573,2 +1577,3 @@ | ||
//('throw', 'throws'); | ||
}); // module: interface/assert.js | ||
@@ -1615,2 +1620,7 @@ | ||
get: function(){ | ||
if (this instanceof String || this instanceof Number) { | ||
return new Assertion(this.constructor(this)); | ||
} else if (this instanceof Boolean) { | ||
return new Assertion(this == true); | ||
} | ||
return new Assertion(this); | ||
@@ -1652,2 +1662,3 @@ }, | ||
}; | ||
}); // module: interface/should.js | ||
@@ -1654,0 +1665,0 @@ |
n.n.n / 2012-01-25 | ||
================== | ||
* browser build | ||
0.1.7 / 2012-01-25 | ||
================== | ||
* added assert tests to browser test runner | ||
* browser update | ||
* `should` interface patch for primitives support in FF | ||
* fix isObject() Thanks @milewise | ||
* travis only on branch `master` | ||
* add instanceof alias `instanceOf`. #6 | ||
* some tests for assert module | ||
0.1.6 / 2012-01-02 | ||
@@ -3,0 +19,0 @@ ================== |
@@ -503,2 +503,3 @@ /*! | ||
* @param {Constructor} | ||
* @alias instanceOf | ||
* @api public | ||
@@ -883,2 +884,3 @@ */ | ||
('below', 'lessThan') | ||
('throw', 'throws'); | ||
('throw', 'throws') | ||
('instanceof', 'instanceOf'); |
@@ -9,3 +9,3 @@ /*! | ||
exports.version = '0.1.6'; | ||
exports.version = '0.1.7'; | ||
@@ -28,2 +28,2 @@ exports.expect = require('./interface/expect'); | ||
}); | ||
}; | ||
}; |
@@ -292,3 +292,3 @@ /*! | ||
assert.isObject = function (val, msg) { | ||
new Assertion(val, msg).to.be.an('object'); | ||
new Assertion(val, msg).to.be.a('object'); | ||
}; | ||
@@ -548,2 +548,2 @@ | ||
//('below', 'lessThan') | ||
//('throw', 'throws'); | ||
//('throw', 'throws'); |
@@ -25,2 +25,7 @@ /*! | ||
get: function(){ | ||
if (this instanceof String || this instanceof Number) { | ||
return new Assertion(this.constructor(this)); | ||
} else if (this instanceof Boolean) { | ||
return new Assertion(this == true); | ||
} | ||
return new Assertion(this); | ||
@@ -61,2 +66,2 @@ }, | ||
return should; | ||
}; | ||
}; |
@@ -6,3 +6,3 @@ { | ||
"keywords": [ "test", "assertion", "assert", "testing" ], | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"repository": { | ||
@@ -9,0 +9,0 @@ "type": "git", |
@@ -1,9 +0,117 @@ | ||
var assert = require('..').assert; | ||
suite('Assert', function () { | ||
/*! | ||
* Module dependencies. | ||
* | ||
* Chai is automatically included in the browser. | ||
*/ | ||
if (!chai) { | ||
var chai = require('..'); | ||
} | ||
var assert = chai.assert; | ||
function err(fn, msg) { | ||
try { | ||
fn(); | ||
chai.fail('expected an error'); | ||
} catch (err) { | ||
assert.equal(msg, err.message); | ||
} | ||
} | ||
suite('assert', function () { | ||
test('version', function () { | ||
assert.match(chai.version, /^\d+\.\d+\.\d+$/ ); | ||
}); | ||
test('isTrue', function () { | ||
assert.isTrue(true); | ||
err(function() { | ||
assert.isTrue(false); | ||
}, "expected false to be true"); | ||
err(function() { | ||
assert.isTrue(1); | ||
}, "expected 1 to be true"); | ||
err(function() { | ||
assert.isTrue('test'); | ||
}, "expected 'test' to be true"); | ||
}); | ||
test('ok', function () { | ||
assert.ok(true); | ||
assert.ok(1); | ||
assert.ok('test'); | ||
err(function () { | ||
assert.ok(false); | ||
}, "expected false to be truthy"); | ||
err(function () { | ||
assert.ok(0); | ||
}, "expected 0 to be truthy"); | ||
err(function () { | ||
assert.ok(''); | ||
}, "expected '' to be truthy"); | ||
}); | ||
}); | ||
test('isFalse', function () { | ||
assert.isFalse(false); | ||
err(function() { | ||
assert.isFalse(true); | ||
}, "expected true to be false"); | ||
err(function() { | ||
assert.isFalse(0); | ||
}, "expected 0 to be false"); | ||
}); | ||
test('equal', function () { | ||
var foo; | ||
assert.equal(foo, undefined); | ||
}); | ||
test('typeof', function () { | ||
assert.typeOf('test', 'string'); | ||
assert.typeOf(true, 'boolean'); | ||
assert.typeOf(5, 'number'); | ||
err(function () { | ||
assert.typeOf(5, 'string'); | ||
}, "expected 5 to be a string"); | ||
}); | ||
test('instanceOf', function() { | ||
function Foo(){} | ||
assert.instanceOf(new Foo(), Foo); | ||
err(function () { | ||
assert.instanceOf(5, Foo); | ||
}, "expected 5 to be an instance of Foo"); | ||
}); | ||
test('isObject', function () { | ||
function Foo(){} | ||
assert.isObject({}); | ||
assert.isObject(new Foo()); | ||
err(function() { | ||
assert.isObject(true); | ||
}, "expected true to be a object"); | ||
err(function() { | ||
assert.isObject(Foo); | ||
}, "expected [Function: Foo] to be a object"); | ||
err(function() { | ||
assert.isObject('foo'); | ||
}, "expected 'foo' to be a object"); | ||
}); | ||
}); |
@@ -419,2 +419,2 @@ /*! | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
136618
4369