/*! Unit.js v2.1.1 | (c) 2019 Nicolas Tallefourtane | http://unitjs.com/license.html */!function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}__webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{enumerable:!0,get:getter})},__webpack_require__.r=function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.t=function(value,mode){if(1&mode&&(value=__webpack_require__(value)),8&mode)return value;if(4&mode&&"object"==typeof value&&value&&value.__esModule)return value;var ns=Object.create(null);if(__webpack_require__.r(ns),Object.defineProperty(ns,"default",{enumerable:!0,value:value}),2&mode&&"string"!=typeof value)for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=1)}([function(module,exports){module.exports=function(actual){return{is:function(expected){},isNot:function(expected){},isEqualTo:function(expected){},isNotEqualTo:function(expected){},isStrictEqualTo:function(expected){},isNotStrictEqualTo:function(expected){},isIdenticalTo:function(expected){},isNotIdenticalTo:function(expected){},match:function(expected){},notMatch:function(expected){},matchEach:function(expected){},notMatchEach:function(expected){},isValid:function(expected){},isNotValid:function(expected){},isType:function(expected){},isNotType:function(expected){},isObject:function(){},isArray:function(){},isFunction:function(){},isString:function(){},isNumber:function(){},isBool:function(){},isBoolean:function(){},isNull:function(){},isUndefined:function(){},isRegExp:function(){},isNotRegExp:function(){},isDate:function(){},isNotDate:function(){},isArguments:function(){},isNotArguments:function(){},isTrue:function(){},isNotTrue:function(){},isTruthy:function(){},isNotTruthy:function(){},isFalse:function(){},isNotFalse:function(){},isFalsy:function(){},isNotFalsy:function(){},isEmpty:function(){},isNotEmpty:function(){},isNaN:function(){},isNotNaN:function(){},exists:function(){},isError:function(){},throws:function(constructor,expected){},hasLength:function(expected){},hasNotLength:function(expected){},isBetween:function(begin,end){},isNotBetween:function(begin,end){},isBefore:function(expected){},isAfter:function(expected){},isGreaterThan:function(expected){},isLessThan:function(expected){},isApprox:function(num,delta){},isInfinite:function(){},isNotInfinite:function(){},isEnumerable:function(property){},isNotEnumerable:function(property){},isFrozen:function(){},isNotFrozen:function(){},isInstanceOf:function(expected){},isNotInstanceOf:function(expected){},hasProperty:function(property,value){},hasNotProperty:function(property,value){},hasOwnProperty:function(property,value){},hasNotOwnProperty:function(property,value){},hasProperties:function(properties){},hasNotProperties:function(properties){},hasOwnProperties:function(properties){},hasKey:function(key,value){},notHasKey:function(key,value){},hasKeys:function(keys){},notHasKeys:function(keys){},hasValue:function(expected){},notHasValue:function(expected){},hasValues:function(expected){},notHasValues:function(expected){},contains:function(expected){},notContains:function(expected){},isReverseOf:function(expected){},isNotReverseOf:function(expected){},startsWith:function(str){},notStartsWith:function(str){},endsWith:function(str){},notEndsWith:function(str){},hasHttpStatus:function(code){},notHasHttpStatus:function(code){},hasHeader:function(field,value){},notHasHeader:function(field,value){},hasHeaderJson:function(){},notHasHeaderJson:function(){},hasHeaderHtml:function(){},notHasHeaderHtml:function(){}}},module.exports=function(actual){return{is:function(expected){},isNot:function(expected){},isEqualTo:function(expected){},isNotEqualTo:function(expected){},isStrictEqualTo:function(expected){},isNotStrictEqualTo:function(expected){},isIdenticalTo:function(expected){},isNotIdenticalTo:function(expected){},match:function(expected){},notMatch:function(expected){},matchEach:function(expected){},notMatchEach:function(expected){},isValid:function(expected){},isNotValid:function(expected){},isType:function(expected){},isNotType:function(expected){},isObject:function(){},isArray:function(){},isFunction:function(){},isString:function(){},isNumber:function(){},isBool:function(){},isBoolean:function(){},isNull:function(){},isUndefined:function(){},isRegExp:function(){},isNotRegExp:function(){},isDate:function(){},isNotDate:function(){},isArguments:function(){},isNotArguments:function(){},isTrue:function(){},isNotTrue:function(){},isTruthy:function(){},isNotTruthy:function(){},isFalse:function(){},isNotFalse:function(){},isFalsy:function(){},isNotFalsy:function(){},isEmpty:function(){},isNotEmpty:function(){},isNaN:function(){},isNotNaN:function(){},exists:function(){},isError:function(){},throws:function(constructor,expected){},hasLength:function(expected){},hasNotLength:function(expected){},isBetween:function(begin,end){},isNotBetween:function(begin,end){},isBefore:function(expected){},isAfter:function(expected){},isGreaterThan:function(expected){},isLessThan:function(expected){},isApprox:function(num,delta){},isInfinite:function(){},isNotInfinite:function(){},isEnumerable:function(property){},isNotEnumerable:function(property){},isFrozen:function(){},isNotFrozen:function(){},isInstanceOf:function(expected){},isNotInstanceOf:function(expected){},hasProperty:function(property,value){},hasNotProperty:function(property,value){},hasOwnProperty:function(property,value){},hasNotOwnProperty:function(property,value){},hasProperties:function(properties){},hasNotProperties:function(properties){},hasOwnProperties:function(properties){},hasKey:function(key,value){},notHasKey:function(key,value){},hasKeys:function(keys){},notHasKeys:function(keys){},hasValue:function(expected){},notHasValue:function(expected){},hasValues:function(expected){},notHasValues:function(expected){},contains:function(expected){},notContains:function(expected){},isReverseOf:function(expected){},isNotReverseOf:function(expected){},startsWith:function(str){},notStartsWith:function(str){},endsWith:function(str){},notEndsWith:function(str){},hasHttpStatus:function(code){},notHasHttpStatus:function(code){},hasHeader:function(field,value){},notHasHeader:function(field,value){},hasHeaderJson:function(){},notHasHeaderJson:function(){},hasHeaderHtml:function(){},notHasHeaderHtml:function(){}}}},function(module,exports,__webpack_require__){"use strict";var test=unitjs;function once(fn){var returnValue,called=!1;return function(){return called||(called=!0,returnValue=fn.apply(this,arguments)),returnValue}}describe("Unit.js provides several API unified and several assertion styles",function(){it("Unit.js style",function(){test.string("foobar").isEqualTo("foobar").isIdenticalTo("foobar")}),it("Assert library of Node.js",function(){test.assert(!0),test.assert.equal("foobar","foobar"),test.assert.strictEqual("foobar","foobar");var assert=test.assert;assert(!0),assert.equal("foobar","foobar"),assert.strictEqual("foobar","foobar")}),it("Should.js library",function(){test.should("foobar").be.type("string"),test.should(!0).be.ok,test.should("foobar").be.equal("foobar");var should=test.should;"foobar".should.be.type("string"),(!0).should.be.ok,"foobar".should.be.equal("foobar"),should("foobar").be.type("string"),should(!0).be.ok,should("foobar").be.equal("foobar")}),it("Must.js library",function(){test.must("foobar").be.a.string(),test.must(!0).be.true(),test.must("foobar").be.equal("foobar");var must=test.must;"foobar".must.be.a.string(),(!0).must.be.true(),"foobar".must.be.equal("foobar"),must("foobar").be.a.string(),must(!0).be.true(),must("foobar").be.equal("foobar")}),it("Unit.js is expressive and fluent",function(){var num,arr,obj={fluent:"is awesome"},copy_obj=obj;test.object(obj).isIdenticalTo(copy_obj).isNotIdenticalTo({fluent:"is awesome"}).isNotEqualTo({fluent:"is awesome"}).is({fluent:"is awesome"}).hasProperty("fluent","is awesome").given(num=10).number(num).isBetween(5,15).then().error(function(){test.number(num/1).isInfinite()}).if(num*=.4).number(num).isApprox(5,1.5).when(function(){(arr=[]).push(num),arr.push("fluent")}).array(arr).hasLength(2).hasValue("fluent").if(arr.push("test flow")).and(arr.push("is expressive")).array(arr).hasLength(4).hasValues(["fluent","test flow","is expressive"])})}),describe("Control flow",function(){describe("Performs the tests without entangled with the flow of other series of tests",function(){it("Series launched with chaining",function(){test.exception(function(){throw test.string("serie1-1").isEqualTo("serie1-1").string("serie1-2").isEqualTo("serie1-2").string("serie1-3").isEqualTo("serie1-3"),new Error("Whoops1-1 !")}).hasMessage("Whoops1-1 !").hasMessage(/Whoop/).string("serie2-1").isEqualTo("serie2-1").exception(function(){throw test.string("serie2-1").isEqualTo("serie2-1").string("serie2-2").isEqualTo("serie2-2").string("serie2-3").isEqualTo("serie2-3"),new Error("Whoops2-1 !")}).hasMessage("Whoops2-1 !").hasMessage(/Whoop/).string("serie3-1").isEqualTo("serie3-1").exception(function(){throw new Error("Whoops3-1 !")}).hasMessage("Whoops3-1 !").string("serie4-1").isEqualTo("serie4-1").exception(function(){throw new Error("Whoops4-1 !")}).hasMessage("Whoops4-1 !").string("serie5-1").isEqualTo("serie5-1").string("serie5-2").isEqualTo("serie5-2").string("serie5-3").isEqualTo("serie5-3").then().string("serie5-4").isEqualTo("serie5-4")}),it("Series launched without chaining",function(){test.exception(function(){throw test.string("serie1-1").isEqualTo("serie1-1"),test.string("serie1-2").isEqualTo("serie1-2"),test.string("serie1-3").isEqualTo("serie1-3"),new Error("Whoops1-1 !")}).hasMessage("Whoops1-1 !").hasMessage(/Whoop/),test.string("serie2-1").isEqualTo("serie2-1"),test.exception(function(){throw test.string("serie2-1").isEqualTo("serie2-1"),test.string("serie2-2").isEqualTo("serie2-2"),test.string("serie2-3").isEqualTo("serie2-3"),new Error("Whoops2-1 !")}).hasMessage("Whoops2-1 !").hasMessage(/Whoop/),test.string("serie3-1").isEqualTo("serie3-1"),test.exception(function(){throw new Error("Whoops3-1 !")}).hasMessage("Whoops3-1 !"),test.string("serie4-1").isEqualTo("serie4-1"),test.exception(function(){throw new Error("Whoops4-1 !")}).hasMessage("Whoops4-1 !"),test.string("serie5-1").isEqualTo("serie5-1"),test.string("serie5-2").isEqualTo("serie5-2"),test.string("serie5-3").isEqualTo("serie5-3"),test.string("serie5-4").isEqualTo("serie5-4")}),it("Chaining with dependency injection",function(){test.$provider("getStrProvider",function(self){return test.object(self).isIdenticalTo(test.$di._container),self.fromSelf="ok from self",function(val){return test.string(val),val}}).case("Test the chain of provider",function(){var fn=test.$di.get("getStrProvider");test.function(fn).string(fn("ok1")).isIdenticalTo("ok1").string(test.$di.get("fromSelf")).isIdenticalTo("ok from self")}).$invoke("getStrProvider",function(getStr){return test.string(getStr("ok2")).isIdenticalTo("ok2"),test}).case("Test the chain of a factorized function").$factory("chainStrTest","getStrProvider",function(getStr){return test.function(getStr).string(getStr("from factory"))}).$di.get("chainStrTest").isIdenticalTo("from factory")}),it("Series with helpers",function(){var str,indicator,log=console.log;console.log=test.spy(),test.given(str="serie1-1").string(str).isEqualTo("serie1-1").when('change "str" value',function(){str="serie1-2"}).then(function(){indicator=!0,test.string(str).isEqualTo("serie1-2")}).case('Checks that "then" execute the function argument').bool(indicator).isTrue().string("1").dump("test.dump()").is("1").bool(console.log.called).isTrue().then(function(){console.log=log}).then("Check break of flow").exception(function(){test.string("1").case().is("1")}).exception(function(){test.string("1").if().is("1")}).exception(function(){test.string("1").and().is("1")}).exception(function(){test.string("1").case.is("1")}).exception(function(){test.string("1").if.is("1")}).exception(function(){test.string("1").and.is("1")}).exception(function(){test.string("1").given().is("1")}).exception(function(){test.string("1").when().is("1")}).exception(function(){test.string("1").then().is("1")}).then("The context of flow",function(){var flow=test.string("1").bool(!0).isTrue();test.object(flow).hasProperty("isTrue").hasProperty("isFalse").hasNotProperty("hasValue").object(test.string("1")).hasProperty("hasValue")})})})}),describe("Passes IOC container",function(){beforeEach(function(){test.$di.set("spy",test.spy()).provider("assertSpy","spy",function(spy){return function(num){return test.assert(spy.callCount===num),test}}).set("callSpy",function(){return test.$di.get("spy"),test})}),afterEach(function(){test.$di.remove("spy").remove("assertSpy").remove("callSpy")}),it("case()",function(){test.case(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({}).case(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("given()",function(){test.given(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({}).given(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("when()",function(){test.when(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({}).when(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("then()",function(){test.then(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({}).then(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("if()",function(){test.if(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({}).if(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("and()",function(){test.and(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(1).then("control flow").object({}).and(function(){test.object(this).isIdenticalTo(test.$di._container),this.callSpy()}).$di.get("assertSpy")(2)}),it("wait()",function(done){var calledAt,spy=test.spy(function(){calledAt=(calledAt=new Date).getTime()}),defAt=new Date;test.wait(20,spy),setTimeout(function(){test.assert(spy.calledOnce),defAt=defAt.getTime(),test.number(calledAt).isGreaterThan(defAt+18),done()},25)}),it("dump()",function(){var log=console.log;console.log=test.spy(),test.string("1").dump("test.dump()").is("1").bool(console.log.called).isTrue(),console.log=log}),it("stats",function(){var countAssert,countAssertOk,total;test.object(test.stats).object(test.stats.assertions).object(test.stats.total).number(test.stats.total.assertions).isGreaterThan(2).number(test.stats.assertions.isObject).isGreaterThan(1).number(test.stats.assertions.isNumber).isGreaterThan(1).case("assert",function(){total=test.stats.total.assertions,countAssert=test.stats.assertions.assert||0,countAssertOk=test.stats.assertions["assert.ok"]||0,test.assert(!0),test.assert.ok(!0),test.number(test.stats.total.assertions).is(total+2).number(test.stats.assertions.assert).is(countAssert+1).number(test.stats.assertions["assert.ok"]).is(countAssertOk+1)})})});var jQuery={ajax:function(){}};describe("Unit.js provides sinon.js",function(){describe("Spies",function(){it("calls the original function",function(){var callback=test.spy();once(callback)(),test.assert(callback.called)}),it("calls the original function only once",function(){var callback=test.spy(),proxy=once(callback);proxy(),proxy(),test.assert(callback.calledOnce),test.assert.strictEqual(callback.callCount,1)}),it("calls original function with right this and args",function(){var callback=test.spy(),obj={};once(callback).call(obj,1,2,3),test.assert(callback.calledOn(obj)),test.assert(callback.calledWith(1,2,3))})}),describe("Stubs",function(){it("returns the return value from the original function",function(){var proxy=once(test.stub().returns(42));test.assert.strictEqual(proxy(),42)})}),describe("Testing Ajax",function(){after(function(){jQuery.ajax.restore()}),it("makes a GET request for todo items",function(){test.stub(jQuery,"ajax"),function(listId,callback){jQuery.ajax({url:"/todo/"+listId+"/items",success:function(data){callback(null,data)}})}(42,test.spy()),test.assert(jQuery.ajax.calledWithMatch({url:"/todo/42/items"}))})}),describe("Mocks",function(){it("returns the return value from the original function",function(){var myAPI={method:function(){}},mock=test.mock(myAPI);mock.expects("method").once().returns(42);var proxy=once(myAPI.method);test.assert.equal(proxy(),42),mock.verify()}),it("test should call a method with exceptions",function(){var myAPI={method:function(){}},mock=test.mock(myAPI);mock.expects("method").once().throws(),test.exception(function(){myAPI.method()}).isInstanceOf(Error),mock.verify()})}),describe("Matchers",function(){it("test should assert fuzzy",function(){var spy=test.spy();spy({pages:42,author:"cjno"}),test.sinon.assert.calledWith(spy,test.sinon.match({author:"cjno"})),test.sinon.assert.calledWith(spy,test.sinon.match.has("pages",42))}),it("test should stub method differently based on argument types",function(){var callback=test.stub();callback.withArgs(test.sinon.match.string).returns(!0),callback.withArgs(test.sinon.match.number).throws("TypeError"),test.bool(callback("abc")).isTrue(),test.exception(function(){callback(123)}).isValid(function(err){if("TypeError"===err.name)return!0})}),it("Combining matchers",function(){var stringOrNumber=test.sinon.match.string.or(test.sinon.match.number),bookWithPages=test.sinon.match.object.and(test.sinon.match.has("pages")),spy=test.spy(),otherSpy=test.spy();spy({pages:42,author:"cjno"}),otherSpy(10),test.sinon.assert.calledWith(spy,bookWithPages),test.sinon.assert.calledWith(otherSpy,stringOrNumber)}),it("Custom matchers",function(){var equal10=test.sinon.match(function(value){return 10===value},"value is not equal to 10"),spy=test.spy(),otherSpy=test.spy();spy(10),otherSpy(42),test.sinon.assert.calledWith(spy,equal10),test.exception(function(){test.sinon.assert.calledWith(otherSpy,equal10)}).hasMessage(/value is not equal to 10/)})}),describe("Sandbox",function(){it("test using test.sinon.test sandbox",test.sinon.test(function(){var myAPI={method:function(){}},mockMyApi=this.mock(myAPI).expects("method").once().returns(42),proxy=once(myAPI.method);test.number(proxy()).isIdenticalTo(42),mockMyApi.verify()}))})}),describe("Asserter array()",function(){describe("array() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.array([]).hasHeader).isUndefined().value(test.array([]).isError).isUndefined().value(test.array([]).hasMessage).isUndefined().value(test.array([]).isInfinite).isUndefined()}),it("Assert that the tested value is an `array`",function(){function Foo(){}test.array([]).array(["a","b","c"]).array(new Array).case("Test failure",function(){test.exception(function(){test.array({})}).exception(function(){test.array("Foo")}).exception(function(){test.array(Foo)}).exception(function(){test.array(1)}).exception(function(){test.array(void 0)}).exception(function(){test.array(!0)}).exception(function(){test.array(!1)}).exception(function(){test.array(null)}).exception(function(){test.array(function(){})})})})}),describe("Assertions of array()",function(){it("is(expected)",function(){test.array(["foo",[0,1]]).is(["foo",[0,1]]).case("Test failure",function(){test.exception(function(){test.array(["foo",[0,1]]).is(["foo",[0,"1"]])}).exception(function(){test.array(["foo",[0,1]]).is(["foo",[0,1,2]])}).exception(function(){test.array(["foo",[0,1]]).is(["foo",[0]])}).exception(function(){test.array(["foo",[0,1]]).is(["foobar",[0,1]])})})}),it("isNot(expected)",function(){test.array(["foo",[0,1]]).isNot(["foo",[0,"1"]]).exception(function(){test.array(["foo",[0,1]]).isNot(["foo",[0,1]])})}),it("isIdenticalTo(expected)",function(){var arr=[1],arr2=arr;test.array(arr).isIdenticalTo(arr2).exception(function(){test.array(arr).isIdenticalTo([1])})}),it("isNotIdenticalTo(expected)",function(){var arr=[1],arr2=arr;test.array(arr).isNotIdenticalTo([1]).exception(function(){test.array(arr).isNotIdenticalTo(arr2)})}),it("isEqualTo(expected)",function(){var arr=[1],arr2=arr;test.array(arr).isEqualTo(arr2).exception(function(){test.array(arr).isEqualTo([1])})}),it("isNotEqualTo(expected)",function(){var arr=[1],arr2=arr;test.array(arr).isNotEqualTo([1]).exception(function(){test.array(arr).isNotEqualTo(arr2)})}),it("match(expected)",function(){test.array(["a","b","c"]).match(/[a-z]/).array([42,10]).match(function(actual){return 10===actual[1]}).exception(function(){test.array([42,"10"]).match(function(actual){return 10===actual[1]})})}),it("notMatch(expected)",function(){test.array(["a","b","c"]).notMatch(/[d-z]/).array([42,10]).notMatch(function(actual){return"10"===actual[1]}).exception(function(){test.array([42,"10"]).notMatch(function(actual){return 42===actual[0]})})}),it("isValid(expected)",function(){test.array(["a","b","c"]).isValid(/[a-z]/).array([42,10]).isValid(function(actual){return 10===actual[1]}).exception(function(){test.array([42,"10"]).isValid(function(actual){return 10===actual[1]})})}),it("isNotValid(expected)",function(){test.array(["a","b","c"]).isNotValid(/[d-z]/).array([42,10]).isNotValid(function(actual){return"10"===actual[1]}).exception(function(){test.array([42,"10"]).isNotValid(function(actual){return 42===actual[0]})})}),it("matchEach(expected)",function(){test.array([10,11,12]).matchEach(function(it){return 10<=it}).exception(function(){test.array([10,11,12]).matchEach(function(it){return 11<=it})})}),it("notMatchEach(expected)",function(){test.array([10,11,12]).notMatchEach(function(it){return 13<=it}).exception(function(){test.array([10,11,12]).notMatchEach(function(it){return 11<=it})})}),it("isEmpty()",function(){test.array([]).isEmpty().exception(function(){test.array([0]).isEmpty()}).exception(function(){test.array([""]).isEmpty()})}),it("isNotEmpty()",function(){test.array(["a"]).isNotEmpty().exception(function(){test.array([]).isNotEmpty()})}),it("hasLength(expected)",function(){test.array([1,2]).hasLength(2).exception(function(){test.array([1,2]).hasLength(1)})}),it("hasNotLength(expected)",function(){test.array([1,2]).hasNotLength(1).exception(function(){test.array([1,2]).hasNotLength(2)})}),it("isEnumerable(property)",function(){var arr=["is enumerable"];test.array(arr).isEnumerable(0).array(arr).isNotEnumerable("length").exception(function(){test.array(arr).isEnumerable("length")})}),it("isNotEnumerable(property)",function(){var arr=["is enumerable"];test.array(arr).isNotEnumerable("length").array(arr).isEnumerable(0).exception(function(){test.array(arr).isNotEnumerable(0)})}),it("hasProperty(property [, value])",function(){test.array(["a","b"]).hasProperty(1).hasProperty(0,"a").exception(function(){test.array(["a","b"]).hasProperty(3)}).exception(function(){test.array(["a","b"]).hasProperty(0,"b")})}),it("hasNotProperty(property [, value])",function(){test.array(["a","b"]).hasNotProperty(2).hasNotProperty(0,"b").exception(function(){test.array(["a","b"]).hasNotProperty(0)}).exception(function(){test.array(["a","b"]).hasNotProperty(1,"b")})}),it("hasKey(key [, value])",function(){test.array(["a","b"]).hasKey(1).hasKey(0,"a").exception(function(){test.array(["a","b"]).hasKey(3)}).exception(function(){test.array(["a","b"]).hasKey(0,"b")})}),it("notHasKey(key [, value])",function(){test.array(["a","b"]).notHasKey(2).notHasKey(0,"b").exception(function(){test.array(["a","b"]).notHasKey(0)}).exception(function(){test.array(["a","b"]).notHasKey(1,"b")})}),it("hasValue(expected)",function(){test.array([1,42,3]).hasValue(42).exception(function(){test.array([1,42,3]).hasValue(0)})}),it("notHasValue(expected)",function(){test.array([1,42,3]).notHasValue(4).exception(function(){test.array([1,42,3]).notHasValue(42)})}),it("hasValues(expected)",function(){test.array([1,42,3]).hasValues([42,3]).exception(function(){test.array([1,42,3]).hasValues([42,3,10])})}),it("notHasValues(expected)",function(){test.array([1,42,3]).notHasValues([4,2]).exception(function(){test.array([1,42,3]).notHasValues([4,1])})}),it("contains(expected [, ...])",function(){test.array([1,2,3]).contains([3]).array([1,2,3]).contains([1,3]).array([1,2,3]).contains([3],[1,3]).array([1,2,3,{a:{b:{d:12}}}]).contains([2],[1,2],[{a:{b:{d:12}}}]).array([[1],[2],[3]]).contains([[3]]).array([[1],[2],[3,4]]).contains([[3]]).array([{a:"a"},{b:"b",c:"c"}]).contains([{a:"a"}],[{b:"b"}]).exception(function(){test.array([1,2,3]).contains([0])})}),it("notContains(expected [, ...])",function(){test.array([[1],[2],[3,4]]).notContains([[0]]).array([{a:"a"},{b:"b",c:"c"}]).notContains([{a:"b"}],[{c:"b"}]).exception(function(){test.array([{a:"a"},{b:"b",c:"c"}]).notContains([{a:"a"}],[{b:"b"}])})}),it("isReverseOf(expected)",function(){test.array([1,2,3]).isReverseOf([3,2,1]).exception(function(){test.array([1,2,3]).isReverseOf([1,2,3])}).exception(function(){test.array([1,2,3]).isReverseOf([3,2,2,1])})}),it("isNotReverseOf(expected)",function(){test.array([1,2,2,3]).isNotReverseOf([3,2,1]).exception(function(){test.array([3,2,1]).isNotReverseOf([3,2,1])})})})}),describe("Asserter bool()",function(){describe("bool() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.bool(!0).hasHeader).isUndefined().value(test.bool(!0).hasProperty).isUndefined().value(test.bool(!0).hasMessage).isUndefined()}),it("Assert that the tested value is a `boolean`",function(){test.bool(!0).bool(!1).case("Test failure",function(){test.exception(function(){test.bool()}).exception(function(){test.bool(0)}).exception(function(){test.bool(1)}).exception(function(){test.bool(void 0)}).exception(function(){test.bool(null)}).exception(function(){test.bool("")}).exception(function(){test.bool("true")}).exception(function(){test.bool("false")}).exception(function(){test.bool("1")}).exception(function(){test.bool("0")}).exception(function(){test.bool([])}).exception(function(){test.bool({})}).exception(function(){test.bool(new Boolean("false")).isFalse()}).exception(function(){test.bool(Boolean("false")).isFalse()})})})}),describe("Assertions of bool()",function(){it("isTrue()",function(){test.bool(!0).isTrue().exception(function(){test.bool(!1).isTrue()})}),it("isNotTrue()",function(){test.bool(!1).isNotTrue().exception(function(){test.bool(!0).isNotTrue()})}),it("isFalse()",function(){test.bool(!1).isFalse().exception(function(){test.bool(!0).isFalse()})}),it("isNotFalse()",function(){test.bool(!0).isNotFalse().exception(function(){test.bool(!1).isNotFalse()})})})}),describe("Asserter date()",function(){describe("date() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.date(new Date).hasHeader).isUndefined().value(test.date(new Date).hasProperty).isUndefined().value(test.date(new Date).hasMessage).isUndefined().value(test.date(new Date).isInfinite).isUndefined()}),it("Assert that the tested value is an instance of `Date`",function(){test.date(new Date).date(new Date("2010, 5, 20")).case("Test failure",function(){test.exception(function(){test.date("2010 5 20")}).exception(function(){test.date(2010)}).exception(function(){test.date(Date)})})})}),describe("Assertions of date()",function(){it("is(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).is(new Date("2010, 5, 20")).case("Test failure",function(){test.exception(function(){test.date(date).is(/2010/)}).exception(function(){test.date(date).is(new Date("2011, 5, 20"))})})}),it("isNot(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isNot(new Date("2012, 02, 28")).case("Test failure",function(){test.exception(function(){test.date(date).isNot(new Date("2010, 5, 20"))}).exception(function(){test.date(date).isNot(date)})})}),it("isIdenticalTo(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isIdenticalTo(date).exception(function(){test.date(date).isIdenticalTo(new Date("2010, 5, 20"))})}),it("isNotIdenticalTo(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isNotIdenticalTo(new Date("2010, 5, 20")).exception(function(){test.date(date).isNotIdenticalTo(date)})}),it("isEqualTo(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isEqualTo(date).exception(function(){test.date(date).isEqualTo(new Date("2010, 5, 20"))})}),it("isNotEqualTo(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isNotEqualTo(new Date("2010, 5, 20")).exception(function(){test.date(date).isNotEqualTo(date)})}),it("match(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).match(/\d/).match(/2010/).exception(function(){test.date(date).match(/^\d$/)}).exception(function(){test.date(date).match(/03/)})}),it("notMatch(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).notMatch(/^\d$/).notMatch(/03/).exception(function(){test.date(date).notMatch(/\d/)}).exception(function(){test.date(date).notMatch(/20/)})}),it("isValid(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isValid(/\d/).isValid(/2010/).exception(function(){test.date(date).isValid(/^\d$/)}).exception(function(){test.date(date).isValid(/03/)})}),it("isNotValid(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isNotValid(/^\d$/).isNotValid(/03/).exception(function(){test.date(date).isNotValid(/\d/)}).exception(function(){test.date(date).isNotValid(/20/)})}),it("isBetween(begin, end)",function(){var date=new Date("2010, 5, 20");test.date(date).isBetween(new Date("1982, 02, 17"),new Date("2012, 02, 28")).exception(function(){test.date(date).isBetween(new Date("2012, 02, 28"),new Date("1982, 02, 17"))})}),it("isNotBetween(begin, end)",function(){var date=new Date("2010, 5, 20");test.date(date).isNotBetween(new Date("2011, 02, 17"),new Date("2012, 02, 28")).exception(function(){test.date(date).isNotBetween(new Date("1982, 02, 17"),new Date("2012, 02, 28"))})}),it("isBefore(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isBefore(new Date("2012, 02, 28")).exception(function(){test.date(date).isBefore(new Date("1982, 02, 17"))})}),it("isAfter(expected)",function(){var date=new Date("2010, 5, 20");test.date(date).isAfter(new Date("1982, 02, 17")).exception(function(){test.date(date).isAfter(new Date("2012, 02, 28"))})})})}),describe("Asserter error()",function(){describe("error() behavior",function(){it("Does not contains inappropriate assertions from the assertions containers",function(){function trigger(){throw new Error("Whoops!")}var indicator=0,deletedAssertions=["isType","isNotType","isObject","isArray","isString","isNumber","isBool","isBoolean","isNull","isUndefined","isRegExp","isNotRegExp","isDate","isNotDate","isArguments","isNotArguments","isEmpty","isNotEmpty","hasLength","hasNotLength","hasProperties","hasNotProperties","hasOwnProperties","hasKeys","notHasKeys","hasValue","notHasValue","hasValues","notHasValues","contains","notContains","startsWith","notStartsWith","endsWith","notEndsWith"];test.value(test.error(trigger).hasHeader).isUndefined().value(test.error(trigger).isInfinite).isUndefined(),deletedAssertions.map(function(method){test.value(test.error(trigger)[method]).isUndefined(),indicator++});var error=test.error(trigger);test.exception(function(){test.value(error.hasMessage).isUndefined()}),test.number(indicator).isIdenticalTo(deletedAssertions.length)}),it("Fails if the tested exception is not an instance of Error",function(){function error(){throw new Error("foo")}function number(){throw 1}function string(){throw"Error"}function object(){throw{name:Error,message:"Whoops!"}}function array(){throw[Error]}var allCatch={number:!0,string:!0,object:!0,array:!0},status={number:!1,string:!1,object:!1,array:!1},check=function(name,trigger){try{test.error(trigger)}catch(e){status[name]=!0}};test.error(error).when(function(){check("number",number),check("string",string),check("object",object),check("array",array)}).object(status).is(allCatch);allCatch={number:!0,string:!0,object:!0,array:!0},status={number:!1,string:!1,object:!1,array:!1},check=function(name,trigger){try{test.exception(trigger)}catch(e){status[name]=!0}};test.exception(error).isError().when(function(){check("number",number),check("string",string),check("object",object),check("array",array)}).object(status).isNot(allCatch).is({number:!1,string:!1,object:!1,array:!1})}),it("dependency injection",function(){var spy=test.spy();test.$di.set("spyException",spy),test.error(function(){throw this.spyException("arg1","arg2"),new Error("Whoops!")}).bool(spy.calledOnce&&spy.calledWithExactly("arg1","arg2")).isTrue()})}),describe("Assertions of error()",function(){it("is(expected)",function(){function trigger(){throw error}var error=new Error("Whoops !");test.error(trigger).is(error).is(new Error("Whoops !")).case("Test failure",function(){test.value(function(){test.error(trigger).is({message:"Whoops !"})}).throws().value(function(){test.error(trigger).is(new TypeError("Whoops !"))}).throws()})}),it("isNot(expected)",function(){function trigger(){throw error}var error=new Error("Whoops !");test.error(trigger).isNot({message:"Whoops !"}).value(function(){test.error(trigger).isNot(error)}).throws()}),it("isIdenticalTo(expected)",function(){function trigger(){throw error}var error=new Error("Whoops !");test.error(trigger).isIdenticalTo(error).value(function(){test.error(trigger).isIdenticalTo(new Error("Whoops !"))}).throws()}),it("isNotIdenticalTo(expected)",function(){function trigger(){throw error}var error=new Error("Whoops !");test.error(trigger).isNotIdenticalTo(new Error("Whoops !")).value(function(){test.error(trigger).isNotIdenticalTo(error)}).throws()}),it("isEqualTo(expected)",function(){function trigger(){throw error}var error=new Error("Whoops !");test.error(trigger).isEqualTo(error).value(function(){test.error(trigger).isEqualTo(new Error("Whoops !"))}).throws()}),it("isNotEqualTo(expected)",function(){function trigger(){throw error}var error=new Error("Whoops !");test.error(trigger).isNotEqualTo(new Error("Whoops !")).value(function(){test.error(trigger).isNotEqualTo(error)}).throws()}),it("match(expected)",function(){function trigger(){throw indicator.set("error trigger called",!0),new Error("Whoops!")}var indicator=test.createCollection();test.error(trigger).match("Whoops!").match(/Whoops/).match(function(exception){return indicator.set("custom error validation called",!0),exception instanceof Error&&/whoops/i.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue().case("Test failure",function(){test.value(function(){test.error(trigger).match("Hey")}).throws().value(function(){test.error(trigger).match(/Hey/)}).throws().value(function(){test.error(trigger).match(function(error){return error instanceof RegExp})}).throws()})}),it("notMatch(expected)",function(){function trigger(){throw indicator.set("error trigger called",!0),new Error("Whoops!")}var indicator=test.createCollection();test.error(trigger).notMatch("Yeah an error").notMatch(/Yeah/).notMatch(function(exception){return indicator.set("custom error validation called",!0),/yeah/.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue().case("Test failure",function(){test.value(function(){test.error(trigger).notMatch("Whoops!")}).throws().value(function(){test.error(trigger).notMatch(/Whoops/)}).throws()})}),it("isValid(expected)",function(){function trigger(){throw indicator.set("error trigger called",!0),new Error("Whoops!")}var indicator=test.createCollection();test.error(trigger).isValid("Whoops!").isValid(/Whoops/).isValid(function(exception){return indicator.set("custom error validation called",!0),exception instanceof Error&&/whoops/i.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue().case("Test failure",function(){test.value(function(){test.error(trigger).isValid("Hey")}).throws().value(function(){test.error(trigger).isValid(/Hey/)}).throws().value(function(){test.error(trigger).isValid(function(error){return error instanceof RegExp})}).throws()})}),it("isNotValid(expected)",function(){function trigger(){throw indicator.set("error trigger called",!0),new Error("Whoops!")}var indicator=test.createCollection();test.error(trigger).isNotValid("Yeah an error").isNotValid(/Yeah/).isNotValid(function(exception){return indicator.set("custom error validation called",!0),/yeah/.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue().case("Test failure",function(){test.value(function(){test.error(trigger).isNotValid("Whoops!")}).throws().value(function(){test.error(trigger).isNotValid(/Whoops/)}).throws()})}),it("isEnumerable(property)",function(){var error=new Error("Whoops !");error.foo="bar",test.error(function(){throw error}).isEnumerable("foo").value(function(){test.error(function(){throw error}).isEnumerable("message")}).throws()}),it("isNotEnumerable(property)",function(){var error=new Error("Whoops !");error.foo="bar",test.error(function(){throw error}).isNotEnumerable("message").value(function(){test.error(function(){throw error}).isNotEnumerable("foo")}).throws()}),it("isFrozen()",function(){var error=new Error("Whoops !"),frozenError=new Error("Whoops !");Object.freeze(frozenError),test.error(function(){throw frozenError}).isFrozen().value(function(){test.error(function(){throw error}).isFrozen()}).throws()}),it("isNotFrozen()",function(){var error=new Error("Whoops !"),frozenError=new Error("Whoops !");Object.freeze(frozenError),test.error(function(){throw error}).isNotFrozen().value(function(){test.error(function(){throw frozenError}).isNotFrozen()}).throws()}),it("isInstanceOf(expected)",function(){test.error(function(){throw new TypeError("Whoops !")}).isInstanceOf(TypeError).value(function(){test.error(function(){throw new Error("Bad type")}).isInstanceOf(TypeError)}).throws()}),it("isNotInstanceOf(expected)",function(){test.error(function(){throw new Error("Whoops !")}).isNotInstanceOf(TypeError).value(function(){test.error(function(){throw new TypeError("Bad type")}).isNotInstanceOf(TypeError)}).throws()}),it("hasProperty(property [, value])",function(){test.error(function(){throw new Error("Whoops !")}).hasProperty("message").hasProperty("message","Whoops !").hasProperty("constructor").case("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).hasProperty("foo")}).throws().value(function(){test.error(function(){throw new Error("Whoops !")}).hasProperty("message","whoops")}).throws()})}),it("hasNotProperty(property [, value])",function(){test.error(function(){throw new Error("Whoops !")}).hasNotProperty("foo").hasNotProperty("message","whoops").case("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).hasNotProperty("message")}).throws().value(function(){test.error(function(){throw new Error("Whoops !")}).hasNotProperty("message","Whoops !")}).throws().value(function(){test.error(function(){throw new Error("Whoops !")}).hasNotProperty("constructor")}).throws()})}),it("hasOwnProperty(property [, value])",function(){test.error(function(){throw new Error("Whoops !")}).hasOwnProperty("message").hasOwnProperty("message","Whoops !").case("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).hasOwnProperty("foo")}).throws().value(function(){test.error(function(){throw new Error("Whoops !")}).hasOwnProperty("message","Grrrr !")}).throws().value(function(){test.error(function(){throw new Error("Whoops !")}).hasOwnProperty("constructor")}).throws()})}),it("hasNotOwnProperty(property [, value])",function(){test.error(function(){throw new Error("Whoops !")}).hasNotOwnProperty("foo").hasNotOwnProperty("message","Grrrr !").hasNotOwnProperty("constructor").case("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).hasNotOwnProperty("message")}).throws().value(function(){test.error(function(){throw new Error("Whoops !")}).hasNotOwnProperty("message","Whoops !")}).throws()})}),it("hasKey(key [, value])",function(){test.error(function(){throw new Error("Whoops !")}).hasKey("message").hasKey("message","Whoops !").hasKey("constructor").case("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).hasKey("foo")}).throws().value(function(){test.error(function(){throw new Error("Whoops !")}).hasKey("message","whoops")}).throws()})}),it("notHasKey(key [, value])",function(){test.error(function(){throw new Error("Whoops !")}).notHasKey("foo").notHasKey("message","whoops").case("Test failure",function(){test.value(function(){test.error(function(){throw new Error("Whoops !")}).notHasKey("message")}).throws().value(function(){test.error(function(){throw new Error("Whoops !")}).notHasKey("message","Whoops !")}).throws().value(function(){test.error(function(){throw new Error("Whoops !")}).notHasKey("constructor")}).throws()})}),it("hasMessage(expected)",function(){function trigger(){throw indicator.set("error constructor called",!0),new Error("I'm a ninja !")}function resetIndicator(){indicator.setAll({})}var exception,indicator=test.createCollection();test.error(trigger).hasMessage("I'm a ninja !").bool(indicator.get("error constructor called")).isTrue().then(resetIndicator()).error(trigger).hasMessage(/ninja/).bool(indicator.get("error constructor called")).isTrue().then(resetIndicator()).case(exception=test.error(trigger)).error(function(){indicator.set("ninjaa is not in error message",!0),exception.hasMessage(/ninjaa/)}).bool(indicator.get("error constructor called")).isTrue().bool(indicator.get("ninjaa is not in error message")).isTrue().then(resetIndicator()).value(function(){indicator.set("ninjaa is not in error message",!0),test.error(trigger).hasMessage(/ninjaa/)}).throws().bool(indicator.get("error constructor called")).isTrue().bool(indicator.get("ninjaa is not in error message")).isTrue()})})}),describe("Asserter exception()",function(){describe("exception() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.exception(function(){throw new Error("hu")}).hasHeader).isUndefined().value(test.exception(function(){throw new Error("hu")}).isBetween).isUndefined()}),it("Takes a function that will throws an exception",function(){var indicator;test.exception(function(){throw indicator=!0,new Error("I'm a ninja !")}).bool(indicator).isTrue().given(indicator=!1).exception(function(){throw indicator=!0,new Error("Whoops!")}).bool(indicator).isTrue()}),it("Error if the trigger don't throws an exception",function(){var indicator;test.given(indicator=!1).value(function(){test.exception(function(){indicator=!0})}).throws().bool(indicator).isTrue()}),it("Assert that thrown with the Error class and a given message",function(){function fn(){throw indicator.set("error constructor called",!0),new Error("I'm a ninja !")}function resetIndicator(){indicator.setAll({})}var exception,indicator=test.createCollection();test.exception(fn).isError().hasMessage("I'm a ninja !").bool(indicator.get("error constructor called")).isTrue().when(exception=test.exception(fn)).exception(function(){exception.isError().hasMessage("I'm a not ninja !")}).given(resetIndicator()).exception(fn).isError().hasMessage(/ninja/).bool(indicator.get("error constructor called")).isTrue().when(exception=test.exception(fn)).exception(function(){exception.isError().hasMessage(/ninjaa/)}).given(resetIndicator()).exception(function(){throw indicator.set("Whoops error, is called",!0),new Error("Whoops!")}).hasMessage("Whoops!").isInstanceOf(Error).bool(indicator.get("Whoops error, is called")).isTrue()}),it("dependency injection",function(){var spy=test.spy();test.$di.set("spyException",spy),test.exception(function(){throw this.spyException("arg1","arg2"),new Error("Whoops!")}).bool(spy.calledOnce&&spy.calledWithExactly("arg1","arg2")).isTrue()})}),describe("Assertions of exception()",function(){it("is(expected)",function(){function trigger(){throw error}var error=new Error("Whoops !");test.exception(trigger).is(error).is(new Error("Whoops !")).case("Test failure",function(){test.value(function(){test.exception(trigger).is({message:"Whoops !"})}).throws().value(function(){test.exception(trigger).is(new String("Whoops !"))}).throws()})}),it("isNot(expected)",function(){function trigger(){throw error}var error=new Error("Whoops !");test.exception(trigger).isNot({message:"Whoops !"}).value(function(){test.exception(trigger).isNot(error)}).throws()}),it("isIdenticalTo(expected)",function(){function trigger(){throw error}var error=new Error("Whoops !");test.exception(trigger).isIdenticalTo(error).value(function(){test.exception(trigger).isIdenticalTo(new Error("Whoops !"))}).throws()}),it("isNotIdenticalTo(expected)",function(){function trigger(){throw error}var error=new Error("Whoops !");test.exception(trigger).isNotIdenticalTo(new Error("Whoops !")).value(function(){test.exception(trigger).isNotIdenticalTo(error)}).throws()}),it("isEqualTo(expected)",function(){function trigger(){throw error}var error=new Error("Whoops !");test.exception(trigger).isEqualTo(error).value(function(){test.exception(trigger).isEqualTo(new Error("Whoops !"))}).throws()}),it("isNotEqualTo(expected)",function(){function trigger(){throw error}var error=new Error("Whoops !");test.exception(trigger).isNotEqualTo(new Error("Whoops !")).value(function(){test.exception(trigger).isNotEqualTo(error)}).throws()}),it("match(expected)",function(){function trigger(){throw indicator.set("error trigger called",!0),new Error("Whoops!")}var indicator=test.createCollection();test.exception(trigger).match("Whoops!").match(/Whoops/).match(function(exception){return indicator.set("custom error validation called",!0),exception instanceof Error&&/whoops/i.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue().case("Test failure",function(){test.value(function(){test.exception(trigger).match("Hey")}).throws().value(function(){test.exception(trigger).match(/Hey/)}).throws().value(function(){test.exception(trigger).match(function(error){return error instanceof RegExp})}).throws()})}),it("notMatch(expected)",function(){function trigger(){throw indicator.set("error trigger called",!0),new Error("Whoops!")}var indicator=test.createCollection();test.exception(trigger).notMatch("Yeah an error").notMatch(/Yeah/).notMatch(function(exception){return indicator.set("custom error validation called",!0),/yeah/.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue().case("Test failure",function(){test.value(function(){test.exception(trigger).notMatch("Whoops!")}).throws().value(function(){test.exception(trigger).notMatch(/Whoops/)}).throws()})}),it("isValid(expected)",function(){function trigger(){throw indicator.set("error trigger called",!0),new Error("Whoops!")}var indicator=test.createCollection();test.exception(trigger).isValid("Whoops!").isValid(/Whoops/).isValid(function(exception){return indicator.set("custom error validation called",!0),exception instanceof Error&&/whoops/i.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue().case("Test failure",function(){test.value(function(){test.exception(trigger).isValid("Hey")}).throws().value(function(){test.exception(trigger).isValid(/Hey/)}).throws().value(function(){test.exception(trigger).isValid(function(error){return error instanceof RegExp})}).throws()})}),it("isNotValid(expected)",function(){function trigger(){throw indicator.set("error trigger called",!0),new Error("Whoops!")}var indicator=test.createCollection();test.exception(trigger).isNotValid("Yeah an error").isNotValid(/Yeah/).isNotValid(function(exception){return indicator.set("custom error validation called",!0),/yeah/.test(exception)}).bool(indicator.get("error trigger called")).isTrue().bool(indicator.get("custom error validation called")).isTrue().case("Test failure",function(){test.value(function(){test.exception(trigger).isNotValid("Whoops!")}).throws().value(function(){test.exception(trigger).isNotValid(/Whoops/)}).throws()})}),it("isType(expected)",function(){function trigger(){throw new Error("Whoops !")}test.exception(trigger).isType("object").exception(function(){throw"Whoops !"}).isType("string").value(function(){test.exception(trigger).isType("function")}).throws()}),it("isNotType(expected)",function(){function trigger(){throw new Error("Whoops !")}test.exception(trigger).isNotType("string").exception(function(){throw"Whoops !"}).isNotType("object").value(function(){test.exception(trigger).isNotType("object")}).throws()}),it("isObject()",function(){test.exception(function(){throw new Error("Whoops !")}).isObject().value(function(){test.exception(function(){throw"error"}).isObject()}).throws()}),it("isArray()",function(){test.exception(function(){throw["error"]}).isArray().value(function(){test.exception(function(){throw new Error("Whoops !")}).isArray()}).throws()}),it("isString()",function(){test.exception(function(){throw"error"}).isString().value(function(){test.exception(function(){throw new Error("Whoops !")}).isString()}).throws()}),it("isNumber()",function(){test.exception(function(){throw 0}).isNumber().value(function(){test.exception(function(){throw"0"}).isNumber()}).throws()}),it("isBool()",function(){test.exception(function(){throw!1}).isBool().value(function(){test.exception(function(){throw 0}).isBool()}).throws()}),it("isBoolean()",function(){test.exception(function(){throw!0}).isBoolean().value(function(){test.exception(function(){throw 1}).isBoolean()}).throws()}),it("isNull()",function(){test.exception(function(){throw null}).isNull().value(function(){test.exception(function(){throw 0}).isNull()}).throws()}),it("isUndefined()",function(){test.exception(function(){throw void 0}).isUndefined().value(function(){test.exception(function(){throw 0}).isUndefined()}).throws()}),it("isRegExp()",function(){test.exception(function(){throw new RegExp("whoops")}).isRegExp().value(function(){test.exception(function(){throw new Error("Whoops !")}).isRegExp()}).throws()}),it("isNotRegExp()",function(){test.exception(function(){throw new Error("Whoops !")}).isNotRegExp().value(function(){test.exception(function(){throw new RegExp("whoops")}).isNotRegExp()}).throws()}),it("isDate()",function(){test.exception(function(){throw new Date}).isDate().value(function(){test.exception(function(){throw new Error("Whoops !")}).isDate()}).throws()}),it("isNotDate()",function(){test.exception(function(){throw new Error("Whoops !")}).isNotDate().value(function(){test.exception(function(){throw new Date}).isNotDate()}).throws()}),it("isArguments()",function(){test.exception(function(){throw function(){return arguments}(1,2,3)}).isArguments().value(function(){test.exception(function(){throw new Error("Whoops !")}).isArguments()}).throws()}),it("isNotArguments()",function(){test.exception(function(){throw new Error("Whoops !")}).isNotArguments().value(function(){test.exception(function(){throw function(){return arguments}(1,2,3)}).isNotArguments()}).throws()}),it("isEmpty()",function(){test.exception(function(){throw""}).isEmpty().exception(function(){throw[]}).isEmpty().exception(function(){throw{}}).isEmpty().exception(function(){throw new Error("Whoops !")}).isEmpty().value(function(){test.exception(function(){throw"Whoops !"}).isEmpty()}).throws()}),it("isNotEmpty()",function(){test.exception(function(){throw"Whoops !"}).isNotEmpty().case("Test failure",function(){test.value(function(){test.exception(function(){throw""}).isNotEmpty()}).throws().value(function(){test.exception(function(){throw[]}).isNotEmpty()}).throws().value(function(){test.exception(function(){throw{}}).isNotEmpty()}).throws().value(function(){test.exception(function(){throw new Error("Whoops !")}).isNotEmpty()}).throws()})}),it("isError()",function(){function trigger(){throw indicator.set("error constructor called",!0),new Error("I'm a ninja !")}var indicator=test.createCollection();test.exception(trigger).isInstanceOf(Error).bool(indicator.get("error constructor called")).isTrue().given(void indicator.setAll({})).exception(trigger).isError().bool(indicator.get("error constructor called")).isTrue()}),it("hasLength(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).hasLength(2).value(function(){test.exception(function(){throw{message:"error",code:42}}).hasLength(1)}).throws()}),it("hasNotLength(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).hasNotLength(1).hasNotLength(3).value(function(){test.exception(function(){throw{message:"error",code:42}}).hasNotLength(2)}).throws()}),it("isEnumerable(property)",function(){test.exception(function(){throw{message:"error",code:42}}).isEnumerable("message").isEnumerable("code").value(function(){test.exception(function(){throw new Error("Whoops !")}).isEnumerable("message")}).throws()}),it("isNotEnumerable(property)",function(){test.exception(function(){throw new Error("Whoops !")}).isNotEnumerable("message").value(function(){test.exception(function(){throw{message:"error",code:42}}).isNotEnumerable("message")}).throws()}),it("isFrozen()",function(){var error={message:"error",code:42},frozenError={message:"error",code:42};Object.freeze(frozenError),test.exception(function(){throw frozenError}).isFrozen().value(function(){test.exception(function(){throw error}).isFrozen()}).throws()}),it("isNotFrozen()",function(){var error={message:"error",code:42},frozenError={message:"error",code:42};Object.freeze(frozenError),test.exception(function(){throw error}).isNotFrozen().value(function(){test.exception(function(){throw frozenError}).isNotFrozen()}).throws()}),it("isInstanceOf(expected)",function(){test.exception(function(){throw new TypeError("Whoops !")}).isInstanceOf(TypeError).value(function(){test.exception(function(){throw new Error("Bad type")}).isInstanceOf(TypeError)}).throws()}),it("isNotInstanceOf(expected)",function(){test.exception(function(){throw new Error("Whoops !")}).isNotInstanceOf(TypeError).value(function(){test.exception(function(){throw new TypeError("Bad type")}).isNotInstanceOf(TypeError)}).throws()}),it("hasProperty(property [, value])",function(){test.exception(function(){throw{message:"error",code:42}}).hasProperty("message").hasProperty("code",42).exception(function(){throw new Error("Whoops !")}).hasProperty("message").hasProperty("message","Whoops !").hasProperty("constructor").case("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasProperty("foo")}).throws().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasProperty("code",1)}).throws()})}),it("hasNotProperty(property [, value])",function(){test.exception(function(){throw{message:"error",code:42}}).hasNotProperty("foo").hasNotProperty("code",1).case("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasNotProperty("message")}).throws().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasNotProperty("code",42)}).throws().value(function(){test.exception(function(){throw new Error("Whoops !")}).hasNotProperty("constructor")}).throws()})}),it("hasOwnProperty(property [, value])",function(){test.exception(function(){throw new Error("Whoops !")}).hasOwnProperty("message").hasOwnProperty("message","Whoops !").case("Test failure",function(){test.value(function(){test.exception(function(){throw new Error("Whoops !")}).hasOwnProperty("foo")}).throws().value(function(){test.exception(function(){throw new Error("Whoops !")}).hasOwnProperty("message","Grrrr !")}).throws().value(function(){test.exception(function(){throw new Error("Whoops !")}).hasOwnProperty("constructor")}).throws()})}),it("hasNotOwnProperty(property [, value])",function(){test.exception(function(){throw new Error("Whoops !")}).hasNotOwnProperty("foo").hasNotOwnProperty("message","Grrrr !").hasNotOwnProperty("constructor").case("Test failure",function(){test.value(function(){test.exception(function(){throw new Error("Whoops !")}).hasNotOwnProperty("message")}).throws().value(function(){test.exception(function(){throw new Error("Whoops !")}).hasNotOwnProperty("message","Whoops !")}).throws()})}),it("hasProperties(properties)",function(){test.exception(function(){throw{message:"error",code:42}}).hasProperties(["message","code"]).case("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasProperties(["message","code","foo"])}).throws().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasProperties(["message"])}).throws()})}),it("hasNotProperties(properties)",function(){test.exception(function(){throw{message:"error",code:42}}).hasNotProperties(["foo","bar"]).hasNotProperties(["foo","code","bar"]).case("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasNotProperties(["message","code"])}).throws()})}),it("hasOwnProperties(properties)",function(){test.exception(function(){throw{message:"error",code:42}}).hasOwnProperties(["message","code"]).case("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasOwnProperties(["message","code","foo"])}).throws().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasOwnProperties(["message"])}).throws()})}),it("hasKey(key [, value])",function(){test.exception(function(){throw{message:"error",code:42}}).hasKey("message").hasKey("code",42).exception(function(){throw new Error("Whoops !")}).hasKey("message").hasKey("message","Whoops !").hasKey("constructor").case("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasKey("foo")}).throws().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasKey("code",1)}).throws()})}),it("notHasKey(key [, value])",function(){test.exception(function(){throw{message:"error",code:42}}).notHasKey("foo").notHasKey("code",1).case("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasKey("message")}).throws().value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasKey("code",42)}).throws().value(function(){test.exception(function(){throw new Error("Whoops !")}).notHasKey("constructor")}).throws()})}),it("hasKeys(keys)",function(){test.exception(function(){throw{message:"error",code:42}}).hasKeys(["message","code"]).case("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasKeys(["message","code","foo"])}).throws().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasKeys(["message"])}).throws()})}),it("notHasKeys(keys)",function(){test.exception(function(){throw{message:"error",code:42}}).notHasKeys(["foo","bar"]).notHasKeys(["foo","code","bar"]).case("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasKeys(["message","code"])}).throws()})}),it("hasValue(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).hasValue("error").hasValue(42).case("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasValue("err")}).throws().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasValue(2)}).throws()})}),it("notHasValue(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).notHasValue("err").notHasValue(2).case("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasValue("error")}).throws().value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasValue(42)}).throws()})}),it("hasValues(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).hasValues(["error"]).hasValues(["error",42]).case("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).hasValues(["foo"])}).throws().value(function(){test.exception(function(){throw{message:"error",code:42}}).hasValues(["error",42,"foo"])}).throws()})}),it("notHasValues(expected)",function(){test.exception(function(){throw{message:"error",code:42}}).notHasValues(["code"]).notHasValues(["message","code","foo"]).case("Test failure",function(){test.value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasValues(["error"])}).throws().value(function(){test.exception(function(){throw{message:"error",code:42}}).notHasValues(["foo","error"])}).throws()})}),it("contains(expected [, ...])",function(){test.exception(function(){throw new Error("Whoops")}).contains({message:"Whoops"}).value(function(){test.exception(function(){throw new Error("Whoops")}).contains({message:"foo"})}).throws()}),it("notContains(expected [, ...])",function(){test.exception(function(){throw new Error("Whoops")}).notContains({message:"foo"}).value(function(){test.exception(function(){throw new Error("Whoops")}).notContains({message:"Whoops"})}).throws()}),it("startsWith(str)",function(){test.exception(function(){throw"An error occured"}).startsWith("An error").value(function(){test.exception(function(){throw"An error occured"}).startsWith("error")}).throws()}),it("notStartsWith(str)",function(){test.exception(function(){throw"An error occured"}).notStartsWith("error").value(function(){test.exception(function(){throw"An error occured"}).notStartsWith("An error")}).throws()}),it("endsWith(str)",function(){test.exception(function(){throw"An error occured"}).endsWith("occured").value(function(){test.exception(function(){throw"An error occured"}).endsWith("error")}).throws()}),it("notEndsWith(str)",function(){test.exception(function(){throw"An error occured"}).notEndsWith("error").value(function(){test.exception(function(){throw"An error occured"}).notEndsWith("occured")}).throws()}),it("hasMessage(expected)",function(){function trigger(){throw indicator.set("error constructor called",!0),new Error("I'm a ninja !")}function resetIndicator(){indicator.setAll({})}var exception,indicator=test.createCollection();test.exception(trigger).hasMessage("I'm a ninja !").bool(indicator.get("error constructor called")).isTrue().then(resetIndicator()).exception(trigger).hasMessage(/ninja/).bool(indicator.get("error constructor called")).isTrue().then(resetIndicator()).case(exception=test.exception(trigger)).exception(function(){indicator.set("ninjaa is not in error message",!0),exception.hasMessage(/ninjaa/)}).bool(indicator.get("error constructor called")).isTrue().bool(indicator.get("ninjaa is not in error message")).isTrue().then(resetIndicator()).value(function(){indicator.set("ninjaa is not in error message",!0),test.exception(trigger).hasMessage(/ninjaa/)}).throws().bool(indicator.get("error constructor called")).isTrue().bool(indicator.get("ninjaa is not in error message")).isTrue()})})}),describe("Asserter function()",function(){describe("function() behavior",function(){it("Does not contains assertions from the assertions containers",function(){function fn(){}test.value(test.function(fn).hasHeader).isUndefined().value(test.function(fn).isAfter).isUndefined().value(test.function(fn).hasMessage).isUndefined()}),it("Assert that the tested value is a `function`",function(){function fn(){}test.function(fn).function(Date).case("Test failure",function(){test.exception(function(){test.function(void 0)}).exception(function(){test.function({})}).exception(function(){test.function([])}).exception(function(){test.function(new Date)}).exception(function(){test.function("foobar")}).exception(function(){test.function(1)}).exception(function(){test.function(!0)}).exception(function(){test.function(!1)}).exception(function(){test.function(null)}).exception(function(){test.function(void 0)}).exception(function(){test.function()})})})}),describe("Assertions of function()",function(){it("is(expected)",function(){function fn(){}var ref=fn;test.function(ref).is(fn).exception(function(){test.function(fn).is(function(){})})}),it("isNot(expected)",function(){function fn(){}test.function(fn).isNot(function(){}).isNot(function(){}).exception(function(){test.function(fn).isNot(fn)})}),it("isIdenticalTo(expected)",function(){function fn(){}var ref=fn;test.function(ref).isIdenticalTo(fn).exception(function(){test.function(fn).isIdenticalTo(function(){})})}),it("isNotIdenticalTo(expected)",function(){function fn(){}test.function(fn).isNotIdenticalTo(function(){}).isNotIdenticalTo(function(){}).exception(function(){test.function(fn).isNotIdenticalTo(fn)})}),it("isEqualTo(expected)",function(){function fn(){}var ref=fn;test.function(ref).isEqualTo(fn).exception(function(){test.function(fn).isEqualTo(function(){})})}),it("isNotEqualTo(expected)",function(){function fn(){}test.function(fn).isNotEqualTo(function(){}).isNotEqualTo(function(){}).exception(function(){test.function(fn).isNotEqualTo(fn)})}),it("match(expected)",function(){function myFunction(){}function fn(){return"hello"}test.function(fn).match("function").match("func").match(function(it){return"hello"===it()}).function(Date).match("Date").function(myFunction).match("myFunction").match(/my/).match(/[a-z]/i).case("Test failure",function(){test.exception(function(){test.function(fn).match(function(it){return"hey"===it()})}).exception(function(){test.function(fn).match("someFunction")}).exception(function(){test.function(myFunction).match(/someFunction/)})})}),it("notMatch(expected)",function(){function myFunction(){}function fn(){return"hello"}test.function(fn).notMatch("foo").notMatch(/[A-Z]/).notMatch(function(it){return"hey"===it()}).function(Date).notMatch("foo").function(myFunction).notMatch("someFunction").notMatch(/some/).case("Test failure",function(){test.exception(function(){test.function(fn).notMatch(function(it){return"hello"===it()})}).exception(function(){test.function(fn).notMatch("function")}).exception(function(){test.function(myFunction).notMatch(/myFunction/)}).exception(function(){test.function(myFunction).notMatch(/my/)}).exception(function(){test.function(myFunction).notMatch("myFunction")})})}),it("isValid(expected)",function(){function myFunction(){}function fn(){return"hello"}test.function(fn).isValid("function").isValid("func").isValid(function(it){return"hello"===it()}).function(Date).isValid("Date").function(myFunction).isValid("myFunction").isValid(/my/).isValid(/[a-z]/i).case("Test failure",function(){test.exception(function(){test.function(fn).isValid(function(it){return"hey"===it()})}).exception(function(){test.function(fn).isValid("someFunction")}).exception(function(){test.function(myFunction).isValid(/someFunction/)})})}),it("isNotValid(expected)",function(){function myFunction(){}function fn(){return"hello"}test.function(fn).isNotValid("foo").isNotValid(/[A-Z]/).isNotValid(function(it){return"hey"===it()}).function(Date).isNotValid("foo").function(myFunction).isNotValid("someFunction").isNotValid(/some/).case("Test failure",function(){test.exception(function(){test.function(fn).isNotValid(function(it){return"hello"===it()})}).exception(function(){test.function(fn).isNotValid("function")}).exception(function(){test.function(myFunction).isNotValid(/myFunction/)}).exception(function(){test.function(myFunction).isNotValid(/my/)}).exception(function(){test.function(myFunction).isNotValid("myFunction")})})}),it("throws([constructor|expected], [expected])",function(){function fn(){}function trigger(){throw new Error("Whoops!")}test.function(trigger).throws().throws("Whoops!").throws(/whoops/i).throws(Error).throws(Error,/whoops/i).case("Test failure",function(){test.value(function(){test.function(fn).throws()}).throws().value(function(){test.function(trigger).throws(TypeError)}).throws().value(function(){test.function(trigger).throws("gloops")}).throws().value(function(){test.function(trigger).throws(/gloops/)}).throws().value(function(){test.function(trigger).throws(TypeError,"gloops")}).throws().value(function(){test.function(trigger).throws(Error,"whoops")}).throws()})}),it("isError()",function(){test.function(function(){throw new Error("Whoops!")}).isError().case("Test failure",function(){test.value(function(){test.function(function(){}).isError()}).throws().value(function(){test.function(function(){throw"error"}).isError()}).throws()})}),it("hasName(expected)",function(){function myFunction(){}test.function(Date).hasName("Date").function(myFunction).hasName("myFunction").case("Test failure",function(){test.exception(function(){test.function(new Date).hasName("RegExp")}).exception(function(){test.function(myFunction).hasName("function")})})})})}),describe("Asserter number()",function(){describe("number() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.number(1).hasHeader).isUndefined().value(test.number(1).hasProperty).isUndefined().value(test.number(1).hasMessage).isUndefined()}),it("Assert that the tested value is a `number`",function(){test.number(2).number(99.98).number(NaN).case("Test failure",function(){test.exception(function(){test.number("0")}).exception(function(){test.number("1")}).exception(function(){test.number(/0/)}).exception(function(){test.number(/1/)}).exception(function(){test.number(!0)}).exception(function(){test.number(!1)}).exception(function(){test.number(null)}).exception(function(){test.number(void 0)}).exception(function(){test.number({})}).exception(function(){test.number([])}).exception(function(){test.number(new Number(0))}).exception(function(){test.number(new Number(1))})})})}),describe("Assertions of number()",function(){it("is(expected)",function(){test.number(2).is(2).case("Test failure",function(){test.exception(function(){test.number(2).is(-2)}).exception(function(){test.number(2).is(2.02)})})}),it("isNot(expected)",function(){test.number(2).isNot(3).isNot("2").isNot(2.1).isNot(.2).isNot(.02).isNot(-2).exception(function(){test.number(2).isNot(2)})}),it("isIdenticalTo(expected)",function(){test.number(1).isIdenticalTo(1).case("Test failure",function(){test.exception(function(){test.number(2).isIdenticalTo(-2)}).exception(function(){test.number(2).isIdenticalTo(2.02)})})}),it("isNotIdenticalTo(expected)",function(){test.number(2).isNotIdenticalTo(3).isNotIdenticalTo("2").isNotIdenticalTo(2.1).isNotIdenticalTo(.2).isNotIdenticalTo(-2).exception(function(){test.number(2).isNotIdenticalTo(2)})}),it("isEqualTo(expected)",function(){test.number(1).isEqualTo(1).isEqualTo("1").case("Test failure",function(){test.exception(function(){test.number(2).isEqualTo(-2)}).exception(function(){test.number(2).isEqualTo(2.02)})})}),it("isNotEqualTo(expected)",function(){test.number(2).isNotEqualTo(3).isNotEqualTo(-2).isNotEqualTo(2.1).isNotEqualTo("2.1").exception(function(){test.number(2).isNotEqualTo(2)})}),it("match(expected)",function(){test.number(2014).match(/20+[1-4]/).number(2014).match(201).number(2014).match(function(it){return 2014===it}).exception(function(){test.number(2).match(/3/)})}),it("notMatch(expected)",function(){test.number(2014).notMatch(/20+[5-6]/).notMatch(/[a-z]/).number(10).notMatch(8).number(10).notMatch(function(it){return 42===it}).case("Test failure",function(){test.exception(function(){test.number(2).notMatch(/2/)}).exception(function(){test.number(2014).notMatch(function(it){return 2014===it})})})}),it("isValid(expected)",function(){test.number(2014).isValid(/20+[1-4]/).number(2014).isValid(201).number(2014).isValid(function(it){return 2014===it}).exception(function(){test.number(2).isValid(/3/)})}),it("isNotValid(expected)",function(){test.number(2014).isNotValid(/20+[5-6]/).isNotValid(/[a-z]/).number(10).isNotValid(8).number(10).isNotValid(function(it){return 42===it}).case("Test failure",function(){test.exception(function(){test.number(2).isNotValid(/2/)}).exception(function(){test.number(2014).isNotValid(function(it){return 2014===it})})})}),it("matchEach(expected)",function(){test.number(2014).matchEach([2,4,1,0]).matchEach([2014,function(it){return 2014===it}]).case("Test failure",function(){test.exception(function(){test.number(2014).matchEach([2014,function(it){return 2041===it}])}).exception(function(){test.number(2).matchEach([2,3])}).exception(function(){test.number(2014).matchEach([2041,function(it){return 2014===it}])})})}),it("notMatchEach(expected)",function(){test.number(2014).notMatchEach([3,200]).notMatchEach([2012,function(it){return 2014!==it}]).case("Test failure",function(){test.exception(function(){test.number(2).notMatchEach([2,3])}).exception(function(){test.number(2014).notMatchEach([2041,function(it){return 2014===it}])}).exception(function(){test.number(2014).notMatchEach([2012,function(it){return 2014===it}])})})}),it("isBetween(begin, end)",function(){test.number(2).isBetween(2,4).number(3).isBetween(2,4).number(4).isBetween(2,4).number(4).isBetween(3.99,4.01).number(1).isBetween(-1.00000001,1.0000000001).case("Test failure",function(){test.exception(function(){test.number(2).isBetween(-3,-1)}).exception(function(){test.number(2).isBetween(3,1)})})}),it("isNotBetween(begin, end)",function(){test.number(1).isNotBetween(2,4).number(5).isNotBetween(2,4).exception(function(){test.number(2).isNotBetween(1,3)})}),it("isBefore(expected)",function(){test.number(1).isBefore(2).isBefore(1.01).exception(function(){test.number(1).isBefore(0)})}),it("isAfter(expected)",function(){test.number(2).isAfter(1).isAfter(1.99).isAfter(-3).exception(function(){test.number(-1).isAfter(0)})}),it("isLessThan(expected)",function(){test.number(1).isLessThan(2).isLessThan(1.01).exception(function(){test.number(1).isLessThan(0)})}),it("isGreaterThan(expected)",function(){test.number(2).isGreaterThan(1).isGreaterThan(1.99).isGreaterThan(-3).exception(function(){test.number(-1).isGreaterThan(0)})}),it("isApprox(num, delta)",function(){test.number(99.98).isApprox(100,.02).exception(function(){test.number(99.98).isApprox(100,.01)})}),it("isInfinite()",function(){test.number(1/0).isInfinite().exception(function(){test.number(1.3333333333333333).isInfinite()})}),it("isNotInfinite()",function(){test.number(1.3333333333333333).isNotInfinite().exception(function(){test.number(1/0).isNotInfinite()})}),it("isNaN()",function(){test.number(NaN).isNaN().number(NaN).isNaN().number(parseInt("a",10)).isNaN().exception(function(){test.number(1).isNaN()}).exception(function(){test.number(new Number(1)).isNaN()}).exception(function(){test.number(0).isNaN()})}),it("isNotNaN()",function(){test.number(1).isNotNaN().number(0).isNotNaN().exception(function(){test.number(NaN).isNotNaN()}).exception(function(){test.number(new Number(NaN)).isNotNaN()}).exception(function(){test.number(NaN).isNotNaN()}).exception(function(){test.number(parseInt("a",10)).isNotNaN()})})})}),describe("Asserter object()",function(){describe("object() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.object({}).hasHeader).isUndefined().value(test.object({}).isError).isUndefined().value(test.object({}).hasMessage).isUndefined().value(test.object({}).isInfinite).isUndefined()}),it("Assert that the tested value is an `object`",function(){function Foo(){}test.object({}).object([]).object(new Date).object(new RegExp).object(new Foo).case("Test failure",function(){test.exception(function(){test.object("Foo")}).exception(function(){test.object(Foo)}).exception(function(){test.object(1)}).exception(function(){test.object(void 0)}).exception(function(){test.object(!0)}).exception(function(){test.object(!1)}).exception(function(){test.object(null)}).exception(function(){test.object(function(){})})})})}),describe("Assertions of object()",function(){it("is(expected)",function(){test.object({fluent:"is awesome",deep:[0,1]}).is({fluent:"is awesome",deep:[0,1]}).exception(function(){test.object({fluent:"is awesome",deep:[0,1]}).is({fluent:"is awesome",deep:[0,2]})})}),it("isNot(expected)",function(){test.object({fluent:"is awesome",deep:[0,1]}).isNot({fluent:"is awesome",deep:[0,"1"]}).exception(function(){test.object({fluent:"is awesome",deep:[0,1]}).isNot({fluent:"is awesome",deep:[0,1]})})}),it("isIdenticalTo(expected)",function(){var obj={},obj2=obj;test.object(obj).isIdenticalTo(obj2).exception(function(){test.object(obj).isIdenticalTo({})})}),it("isNotIdenticalTo(expected)",function(){var obj={},obj2=obj;test.object(obj).isNotIdenticalTo({}).exception(function(){test.object(obj).isNotIdenticalTo(obj2)})}),it("isEqualTo(expected)",function(){var obj={},obj2=obj;test.object(obj).isEqualTo(obj2).exception(function(){test.object(obj).isEqualTo({})})}),it("isNotEqualTo(expected)",function(){var obj={foo:"bar"},obj2=obj;test.object(obj).isNotEqualTo({foo:"bar",baz:"bar"}).exception(function(){test.object(obj).isNotEqualTo(obj2)})}),it("match(expected)",function(){test.object({hello:"world"}).match(function(obj){return"world"==obj.hello}).exception(function(){test.object({hello:"world"}).match(function(obj){return"foo"==obj.hello})})}),it("notMatch(expected)",function(){test.object({hello:"world"}).notMatch(function(obj){return"E.T"==obj.hello}).exception(function(){test.object({hello:"world"}).notMatch(function(obj){return"world"==obj.hello})})}),it("isValid(expected)",function(){test.object({hello:"world"}).isValid(function(obj){return"world"==obj.hello}).exception(function(){test.object({hello:"world"}).isValid(function(obj){return"foo"==obj.hello})})}),it("isNotValid(expected)",function(){test.object({hello:"world"}).isNotValid(function(obj){return"E.T"==obj.hello}).exception(function(){test.object({hello:"world"}).isNotValid(function(obj){return"world"==obj.hello})})}),it("matchEach(expected)",function(){test.object({foo:"bar",hey:"you",joker:1}).matchEach(function(it,key){return"joker"==key?"number"==typeof it:"string"==typeof it}).exception(function(){test.object({foo:"bar",hey:"you",joker:1}).matchEach(function(it,key){return"string"==typeof it})})}),it("notMatchEach(expected)",function(){test.object({foo:"bar",hey:"you",joker:1}).notMatchEach(function(it,key){if("other"==key)return!0}).exception(function(){test.object({foo:"bar",hey:"you",joker:1}).notMatchEach(function(it,key){if("foo"==key)return!0})}).exception(function(){test.object({foo:"bar",hey:"you",joker:1}).notMatchEach(function(it,key){return"string"==typeof it})})}),it("isArray()",function(){test.object([]).isArray().exception(function(){test.object({}).isArray()}).exception(function(){test.object(new Date).isArray()})}),it("isRegExp()",function(){test.object(/[0-9]+/).isRegExp().exception(function(){test.object({}).isRegExp()}).exception(function(){test.object(new Date).isRegExp()})}),it("isNotRegExp()",function(){test.object(new Date).isNotRegExp().exception(function(){test.object(/[0-9]+/).isNotRegExp()})}),it("isDate()",function(){test.object(new Date).isDate().exception(function(){test.object({}).isDate()}).exception(function(){test.object(/[0-9]+/).isDate()})}),it("isNotDate()",function(){test.object(/[0-9]+/).isNotDate().exception(function(){test.object(new Date).isNotDate()})}),it("isArguments()",function(){(function(){var args=arguments;test.object(arguments).isArguments(),test.object(args).isArguments()})(1,2,3),test.exception(function(){test.object({0:"a"}).isArguments()})}),it("isNotArguments()",function(){(function(){test.object(arguments).isArguments().object([1,2,3]).isNotArguments().object({0:1,1:2,2:3}).isNotArguments()})(1,2,3),test.exception(function(){test.object(arguments).isNotArguments()})}),it("isEmpty()",function(){test.object({}).isEmpty().exception(function(){test.object({0:"a"}).isEmpty()})}),it("isNotEmpty()",function(){test.object({hello:"Nico"}).isNotEmpty().exception(function(){test.object({}).isNotEmpty()})}),it("hasLength(expected)",function(){test.object({foo:"bar",other:"baz"}).hasLength(2).exception(function(){test.object({foo:"bar",other:"baz"}).hasLength(3)})}),it("hasNotLength(expected)",function(){test.object({foo:"bar",other:"baz"}).hasNotLength(4).exception(function(){test.object({foo:"bar",other:"baz"}).hasNotLength(2)})}),it("isEnumerable(property)",function(){test.object({prop:"foobar"}).isEnumerable("prop").exception(function(){test.object({prop:"foobar"}).isEnumerable("length")})}),it("isNotEnumerable(property)",function(){test.object(Object.create({},{prop:{enumerable:0}})).isNotEnumerable("prop").exception(function(){test.object({prop:"foobar"}).isNotEnumerable("prop")})}),it("isFrozen()",function(){test.object(Object.freeze({})).isFrozen().exception(function(){test.object({}).isFrozen()})}),it("isNotFrozen()",function(){test.object({}).isNotFrozen().exception(function(){test.object(Object.freeze({})).isNotFrozen()})}),it("isInstanceOf(expected)",function(){test.object(new Date).isInstanceOf(Date).exception(function(){test.object(new Date).isInstanceOf(Error)})}),it("isNotInstanceOf(expected)",function(){test.object(new Date).isNotInstanceOf(RegExp).exception(function(){test.object(new Date).isNotInstanceOf(Object)}).exception(function(){test.object(new Date).isNotInstanceOf(Date)})}),it("hasProperty(property [, value])",function(){test.object({foo:"bar"}).hasProperty("foo").object({foo:"bar"}).hasProperty("foo","bar").exception(function(){test.object({foo:"bar"}).hasProperty("bar")}).exception(function(){test.object({foo:"bar"}).hasProperty("foo","ba")})}),it("hasNotProperty(property [, value])",function(){test.object({foo:"bar"}).hasNotProperty("bar").object({foo:"bar"}).hasNotProperty("foo","baz").exception(function(){test.object({foo:"bar"}).hasNotProperty("foo")}).exception(function(){test.object({foo:"bar"}).hasNotProperty("foo","bar")})}),it("hasOwnProperty(property [, value])",function(){test.object({foo:"bar"}).hasOwnProperty("foo").object({foo:"bar"}).hasOwnProperty("foo","bar").exception(function(){test.object({foo:"bar"}).hasOwnProperty("bar")}).exception(function(){test.object({foo:"bar"}).hasOwnProperty("foo","ba")})}),it("hasNotOwnProperty(property [, value])",function(){test.object({foo:"bar"}).hasNotOwnProperty("bar").object({foo:"bar"}).hasNotOwnProperty("foo","baz").exception(function(){test.object({foo:"bar"}).hasNotOwnProperty("foo")}).exception(function(){test.object({foo:"bar"}).hasNotOwnProperty("foo","bar")})}),it("hasProperties(properties)",function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasProperties(["other","bar","foo"]).exception(function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasProperties(["other","bar"])})}),it("hasNotProperties(properties)",function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasNotProperties(["other","foo"]).exception(function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasNotProperties(["bar","other","foo"])})}),it("hasOwnProperties(properties)",function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasOwnProperties(["other","bar","foo"]).exception(function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasOwnProperties(["other","bar"])})}),it("hasKey(key [, value])",function(){test.object({foo:"bar"}).hasKey("foo").object({foo:"bar"}).hasKey("foo","bar").exception(function(){test.object({foo:"bar"}).hasKey("bar")}).exception(function(){test.object({foo:"bar"}).hasKey("foo","ba")})}),it("notHasKey(key [, value])",function(){test.object({foo:"bar"}).notHasKey("bar").object({foo:"bar"}).notHasKey("foo","baz").exception(function(){test.object({foo:"bar"}).notHasKey("foo")}).exception(function(){test.object({foo:"bar"}).notHasKey("foo","bar")})}),it("hasKeys(keys)",function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasKeys(["other","bar","foo"]).exception(function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).hasKeys(["other","bar"])})}),it("notHasKeys(keys)",function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).notHasKeys(["other","foo"]).exception(function(){test.object({foo:"bar",bar:"huhu",other:"vroom"}).notHasKeys(["bar","other","foo"])})}),it("hasValue(expected)",function(){test.object({life:42,love:69}).hasValue(42).exception(function(){test.object({life:42,love:69}).hasValue("42")})}),it("notHasValue(expected)",function(){test.object({life:42,love:69}).notHasValue(4).exception(function(){test.object({life:42,love:69}).notHasValue(42)})}),it("hasValues(expected)",function(){test.object({life:42,love:69}).hasValues([42,69]).exception(function(){test.object([1,42,3]).hasValues([42,3.01])})}),it("notHasValues(expected)",function(){test.object({life:42,love:69}).notHasValues([43,68]).exception(function(){test.object([1,42,3]).notHasValues([1,42,3])})}),it("contains(expected [, ...])",function(){test.object({a:{b:10},b:{c:10,d:11,a:{b:10,c:11}}}).contains({a:{b:10},b:{c:10,a:{c:11}}}).object({a:"a",b:{c:"c"}}).contains({b:{c:"c"}}).contains({b:{c:"c"}},{a:"a"}).exception(function(){test.object({foo:{a:"a"},bar:{b:"b",c:"c"}}).contains({foo:{a:"a"}},{bar:{b:"c"}})})}),it("notContains(expected [, ...])",function(){test.object({a:"a"},{b:"b",c:"c"}).notContains({c:"b"}).exception(function(){test.object({foo:{a:"a"},bar:{b:"b",c:"c"}}).notContains({foo:{a:"a"},bar:{c:"c"}})})}),it("hasName(expected)",function(){test.object(new Date(2010,5,28)).hasName("Date").exception(function(){test.object(new Date(2010,5,28)).hasName("date")})})})}),describe("Asserter regexp()",function(){describe("regexp() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.regexp(new RegExp).hasHeader).isUndefined().value(test.regexp(new RegExp).hasMessage).isUndefined().value(test.regexp(new RegExp).isInfinite).isUndefined()}),it("Assert that the tested value is an instance of `RegExp`",function(){test.regexp(/foobar/).regexp(new RegExp("foo","i")).case("Test failure",function(){test.exception(function(){test.regexp({})}).exception(function(){test.regexp([])}).exception(function(){test.regexp("")}).exception(function(){test.regexp()}).exception(function(){test.regexp(void 0)}).exception(function(){test.regexp(null)}).exception(function(){test.regexp(!0)}).exception(function(){test.regexp(!1)}).exception(function(){test.regexp(0)}).exception(function(){test.regexp(1)}).exception(function(){test.regexp("[a-z]")}).exception(function(){test.regexp("/foobar/")}).exception(function(){test.regexp(RegExp)}).exception(function(){test.regexp(new Date)})})})}),describe("Assertions of regexp()",function(){it("is(expected)",function(){var regexp=new RegExp(/[a-z]/);test.regexp(regexp).is(new RegExp(/[a-z]/)).exception(function(){test.regexp(regexp).is(/A-Z/)})}),it("isNot(expected)",function(){var regexp=new RegExp(/[a-z]/);test.regexp(regexp).isNot(new RegExp(/[A-Z]/)).exception(function(){test.regexp(regexp).isNot(/[a-z]/)})}),it("isIdenticalTo(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).isIdenticalTo(ref).exception(function(){test.regexp(regexp).isIdenticalTo(/[a-z]/)})}),it("isNotIdenticalTo(expected)",function(){var regexp=new RegExp(/[a-z]/);test.regexp(regexp).isNotIdenticalTo(new RegExp(/[a-z]/)).exception(function(){test.regexp(regexp).isNotIdenticalTo(regexp)})}),it("isEqualTo(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).isEqualTo(ref).exception(function(){test.regexp(regexp).isEqualTo(/[a-z]/)})}),it("isNotEqualTo(expected)",function(){var regexp=new RegExp(/[a-z]/);test.regexp(regexp).isNotEqualTo(new RegExp(/[a-z]/)).exception(function(){test.regexp(regexp).isNotEqualTo(regexp)})}),it("match(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).match(function(reg){return reg===ref}).exception(function(){test.regexp(regexp).match(function(actual){return"[A-Z]"==actual.source})})}),it("notMatch(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).notMatch(function(actual){var reg=new RegExp(/[a-z]/);return reg===ref||reg===actual}).exception(function(){test.regexp(regexp).notMatch(function(actual){return"[a-z]"==actual.source})})}),it("isValid(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).isValid(function(reg){return reg===ref}).exception(function(){test.regexp(regexp).isValid(function(actual){return"[A-Z]"==actual.source})})}),it("isNotValid(expected)",function(){var regexp=new RegExp(/[a-z]/),ref=regexp;test.regexp(regexp).isNotValid(function(actual){var reg=new RegExp(/[a-z]/);return reg===ref||reg===actual}).exception(function(){test.regexp(regexp).isNotValid(function(actual){return"[a-z]"==actual.source})})}),it("isEnumerable(property)",function(){var regexp=new RegExp(/[a-z]/);Object.defineProperty(regexp,"myCustom",{enumerable:!0,value:"static"}),test.regexp(regexp).isEnumerable("myCustom").exception(function(){test.regexp(regexp).isEnumerable("ignoreCase")})}),it("isNotEnumerable(property)",function(){var regexp=new RegExp(/[a-z]/);Object.defineProperty(regexp,"myCustom",{enumerable:!0,value:"static"}),test.regexp(regexp).isNotEnumerable("lastIndex").isNotEnumerable("ignoreCase").isNotEnumerable("multiline").exception(function(){test.regexp(regexp).isNotEnumerable("myCustom")})}),it("isFrozen",function(){var regexp=new RegExp(/[a-z]/);Object.freeze(regexp),test.regexp(regexp).isFrozen().exception(function(){test.regexp(/[a-z]/).isFrozen()})}),it("isNotFrozen",function(){var regexp=new RegExp(/[a-z]/),regexpFrozen=new RegExp(/[a-z]/);Object.freeze(regexpFrozen),test.regexp(regexp).isNotFrozen().exception(function(){test.regexp(regexpFrozen).isNotFrozen()})}),it("hasProperty(property [, value])",function(){test.regexp(/[a-z]/).hasProperty("lastIndex").hasProperty("constructor").exception(function(){test.regexp(/[a-z]/).hasProperty("foo")})}),it("hasNotProperty(property [, value])",function(){test.regexp(/[a-z]/).hasNotProperty("foobar").exception(function(){test.regexp(/[a-z]/).hasNotProperty("lastIndex")})}),it("hasOwnProperty(property [, value])",function(){test.regexp(/[a-z]/).hasOwnProperty("lastIndex").exception(function(){test.regexp(/[a-z]/).hasOwnProperty("constructor")})}),it("hasNotOwnProperty(property [, value])",function(){test.regexp(/[a-z]/).hasNotOwnProperty("constructor").exception(function(){test.regexp(/[a-z]/).hasNotOwnProperty("lastIndex")})}),it("hasKey(key [,value ])",function(){test.regexp(/[a-z]/).hasKey("lastIndex").hasKey("constructor").exception(function(){test.regexp(/[a-z]/).hasKey("foo")})}),it("notHasKey(key [,value])",function(){test.regexp(/[a-z]/).notHasKey("foobar").exception(function(){test.regexp(/[a-z]/).notHasKey("lastIndex")})})})}),describe("Asserter string()",function(){describe("string() behavior",function(){it("Does not contains assertions from the assertions containers",function(){test.value(test.string("").hasHeader).isUndefined().value(test.string("").hasProperty).isUndefined().value(test.string("").hasMessage).isUndefined().value(test.string("").isInfinite).isUndefined()}),it("Assert that the tested value is a `string`",function(){test.string("").string("Hello").case("Test failure",function(){test.exception(function(){test.string()}).exception(function(){test.string({})}).exception(function(){test.string([])}).exception(function(){test.string(1)}).exception(function(){test.string(/foobar/)}).exception(function(){test.string(!0)}).exception(function(){test.string(!1)}).exception(function(){test.string(null)}).exception(function(){test.string(void 0)})})})}),describe("Assertions of string()",function(){it("is(expected)",function(){var str="Hello world !";test.string(str).is("Hello world !").exception(function(){test.string(str).is("foo")})}),it("isNot(expected)",function(){var str="Hello world !";test.string(str).isNot("hello world !").exception(function(){test.string(str).isNot("Hello world !")})}),it("isIdenticalTo(expected)",function(){var str="Hello world !";test.string(str).isIdenticalTo("Hello world !").exception(function(){test.string(str).isIdenticalTo("Hello World !")})}),it("isNotIdenticalTo(expected)",function(){var str="Hello world !";test.string(str).isNotIdenticalTo("hello world !").exception(function(){test.string(str).isNotIdenticalTo("Hello world !")})}),it("isEqualTo(expected)",function(){var str="Hello world !";test.string(str).isEqualTo("Hello world !").exception(function(){test.string(str).isEqualTo("Hello World !")})}),it("isNotEqualTo(expected)",function(){var str="Hello world !";test.string(str).isNotEqualTo("hello world !").exception(function(){test.string(str).isNotEqualTo("Hello world !")})}),it("match(expected)",function(){test.string("Hello").match("Hello"),test.string("Hello world !").match(/world/i),test.string("hello").match(function(it){return"hello"===it}),test.exception(function(){test.string("hello").match(/foo/)})}),it("notMatch(expected)",function(){test.string("foobar").notMatch("some value").notMatch(/[foo]+bazzz$/).string("foo").notMatch(function(it){return"bar"===it}).exception(function(){test.string("Hello Nico!").notMatch(/nico/i)})}),it("isValid(expected)",function(){test.string("Hello").isValid("Hello"),test.string("Hello world !").isValid(/world/i),test.string("hello").isValid(function(it){return"hello"===it}),test.exception(function(){test.string("hello").isValid(/foo/)})}),it("isNotValid(expected)",function(){test.string("foobar").isNotValid("some value").isNotValid(/[foo]+bazzz$/).string("foo").isNotValid(function(it){return"bar"===it}).exception(function(){test.string("Hello Nico!").notMatch(/nico/i)})}),it("matchEach(expected)",function(){var str="Hello Nico!";test.string(str).matchEach([/hello/i,"Nico",function(it){return"Hello Nico!"===it}]).case("Test failure",function(){test.exception(function(){test.string(str).matchEach([/hello/i,"nico",function(it){return"Hello Nico!"===it}])}).exception(function(){test.string(str).matchEach([/hello/i,"Nico",function(it){return"Hello nico!"===it}])})})}),it("notMatchEach(expected)",function(){var str="Hello Nico!";test.string(str).notMatchEach([/foo/i,"bad word",function(it){return"Bye"===it}]).case("Test failure",function(){test.exception(function(){test.string(str).notMatchEach([/hello/,"Nico",function(it){return"Hello !"===it}])}).exception(function(){test.string(str).notMatchEach([/hello/,"nico",function(it){return"Hello Nico!"===it}])})})}),it("isEmpty()",function(){test.string("").isEmpty().exception(function(){test.string(str).isEmpty()})}),it("isNotEmpty()",function(){test.string("a").isNotEmpty().exception(function(){test.string("").isNotEmpty()})}),it("hasLength(expected)",function(){test.string("Hello Nico").hasLength(10).exception(function(){test.string("abc").hasLength(4)})}),it("hasNotLength(expected)",function(){test.string("Hello Nico").hasNotLength(11).exception(function(){test.string("abc").hasNotLength(3)})}),it("hasValue(expected)",function(){test.string("Hello, Nico!").hasValue("Nico").exception(function(){test.string("Hello").hasValue("hello")})}),it("notHasValue(expected)",function(){test.string("Hello, Nico!").notHasValue("Bye").exception(function(){test.string("Hello").notHasValue("Hello")})}),it("hasValues(expected)",function(){test.string("Hello Nico!").hasValues(["Hello","Nico"]).exception(function(){test.string("Hello Nico!").hasValues(["Hi","Nico"])})}),it("notHasValues(expected)",function(){test.string("Sarah Connor ?").notHasValues(["next","door"]).exception(function(){test.string("Hello Nico!").notHasValues(["Hi","Nico"])})}),it("contains(expected [, ...])",function(){test.string("hello boy").contains("boy").string("KISS principle : Keep it Simple, Stupid").contains("Simple","principle",":").exception(function(){test.string("Hello").contains("hello")})}),it("notContains(expected [, ...])",function(){test.string("hello boy").notContains("bye").exception(function(){test.string("Hello").notContains("Hello")})}),it("startsWith(str)",function(){test.string("foobar").startsWith("foo").exception(function(){test.string("Hello the world").startsWith("world")})}),it("notStartsWith(str)",function(){test.string("foobar").notStartsWith("bar").exception(function(){test.string("Hello the world").notStartsWith("Hello")})}),it("endsWith(str)",function(){test.string("foobar").endsWith("bar").exception(function(){test.string("Hello the world").endsWith("Hello")})}),it("notEndsWith(str)",function(){test.string("foobar").notEndsWith("foo").exception(function(){test.string("Hello the world").notEndsWith("world")})})})});var rawAssertions=__webpack_require__(0);describe("Asserter undefined()",function(){describe("undefined() behavior",function(){it("Does not contains assertions from the assertions containers",function(){var assertions=rawAssertions.call(this,void 0);for(var method in assertions)"hasOwnProperty"==method&&test.undefined(void 0)[method]===Object.hasOwnProperty||test.value(test.undefined(void 0)[method]).isUndefined();test.exception(function(){test.value(test.undefined(void 0).hasOwnProperty).isUndefined()})}),it("Assert that the tested value is `undefined`",function(){test.undefined(void 0).undefined().case("Test failure",function(){test.exception(function(){test.undefined(0)}).exception(function(){test.undefined(1)}).exception(function(){test.undefined("undefined")}).exception(function(){test.undefined(null)}).exception(function(){test.undefined(!1)}).exception(function(){test.undefined(!0)}).exception(function(){test.undefined("")}).exception(function(){test.undefined([])}).exception(function(){test.undefined({})}).exception(function(){test.undefined(function(){})})})})})});rawAssertions=__webpack_require__(0);describe("Asserter value()",function(){describe("value() behavior",function(){it("value() has all assertions",function(){var assertions=rawAssertions.call(this,void 0);for(var method in assertions)test.value(test.value(void 0)[method]).exists();test.exception(function(){test.value(test.value(void 0).foobar_not_exist).exists()})})}),describe("Assertions of value()",function(){it("is(expected)",function(){test.value({fluent:"is awesome",deep:[0,1]}).is({fluent:"is awesome",deep:[0,1]}).exception(function(){test.value({fluent:"is awesome",deep:[0,1]}).is({fluent:"is awesome",deep:[0,2]})})}),it("isNot(expected)",function(){test.value({fluent:"is awesome",deep:[0,1]}).isNot({fluent:"is awesome",deep:[0,"1"]}).exception(function(){test.value({fluent:"is awesome",deep:[0,1]}).isNot({fluent:"is awesome",deep:[0,1]})})}),it("isIdenticalTo(expected)",function(){test.value(1).isIdenticalTo(1).exception(function(){test.value(1).isIdenticalTo(2)})}),it("isNotIdenticalTo(expected)",function(){test.value("1").isNotIdenticalTo(1).exception(function(){test.value(1).isNotIdenticalTo(1)})}),it("isEqualTo(expected)",function(){test.value("1").isEqualTo(1).exception(function(){test.value(1).isEqualTo(1.1)})}),it("isNotEqualTo(expected)",function(){test.value("foobar").isNotEqualTo([]).exception(function(){test.value("foobar").isNotEqualTo("foobar")})}),it("match(expected)",function(){test.value("foobar").match(/[fo]+bar$/).value(["a","b","c"]).match(/[a-z]/).value(10).match(10).exception(function(){test.value("foobar").match("whoops")})}),it("notMatch(expected)",function(){test.value("foobar").notMatch(/[foo]+bazzz$/).value(["a","b","c"]).notMatch(/[d-z]/).value(10).notMatch(8).exception(function(){test.value("foobar").notMatch("foobar")})}),it("matchEach(expected)",function(){test.value([10,11,12]).matchEach(function(it){return 10<=it}).exception(function(){test.value([10,11,12]).matchEach(function(it){return 11<=it})})}),it("notMatchEach(expected)",function(){test.value([10,11,12]).notMatchEach(function(it){return 13<=it}).exception(function(){test.value([10,11,12]).notMatchEach(function(it){return 11<=it})})}),it("isValid(expected)",function(){test.value(42).isValid(function(actual){return 42===actual}).exception(function(){test.value(42).isValid(function(actual){return"expected value"===actual})})}),it("isNotValid(expected)",function(){test.value(42).isNotValid(function(actual){return 44===actual}).exception(function(){test.value(42).isNotValid(function(actual){return 42===actual})})}),it("isType(expected)",function(){test.value("foobar").isType("string").value(0).isType("number").value(1).isType("number").value(1.2).isType("number").value("1").isType("string").value({}).isType("object").value(void 0).isType("undefined").value(null).isType("object").value(!0).isType("boolean").value(!1).isType("boolean").exception(function(){test.value("1").isType("number")})}),it("isNotType(expected)",function(){test.value({}).isNotType("string").value("0").isNotType("number").value("1").isNotType("number").value("1.2").isNotType("number").value(1).isNotType("string").value(null).isNotType("undefined").value(void 0).isNotType("object").value("true").isNotType("boolean").value("false").isNotType("boolean").exception(function(){test.value("1").isNotType("string")})}),it("isObject()",function(){test.value({}).isObject().exception(function(){test.value(function(){}).isObject()})}),it("isArray()",function(){test.value([]).isArray().exception(function(){test.value({}).isArray()})}),it("isFunction()",function(){test.value(function(){}).isFunction().exception(function(){test.value(new Date).isFunction()})}),it("isString()",function(){test.value("foobar").isString().exception(function(){test.value(10.2).isString()})}),it("isNumber()",function(){test.value(42).isNumber().exception(function(){test.value(!0).isNumber()})}),it("isBool() - alias of isBoolean()",function(){test.value(!1).isBool().exception(function(){test.value(null).isBool()})}),it("isBoolean()",function(){test.value(!0).isBoolean().exception(function(){test.value(void 0).isBoolean()})}),it("isNull()",function(){test.value(null).isNull().exception(function(){test.value(!1).isNull()}).exception(function(){test.value(void 0).isNull()}).exception(function(){test.value(0).isNull()})}),it("isUndefined()",function(){test.value(void 0).isUndefined().exception(function(){test.value(null).isUndefined()})}),it("isRegExp()",function(){test.value(/[0-9]+/).isRegExp().exception(function(){test.value("/[0-9]+/").isRegExp()})}),it("isNotRegExp()",function(){test.value(new Date).isNotRegExp().exception(function(){test.value(/foo/).isNotRegExp()})}),it("isDate()",function(){test.value(new Date).isDate().exception(function(){test.value({month:5,year:2012,day:12}).isDate()})}),it("isNotDate()",function(){test.value(/[0-9]+/).isNotDate().exception(function(){test.value(new Date).isNotDate()})}),it("isArguments()",function(){(function(){test.value(arguments).isArguments()})(1,2,3),test.exception(function(){test.value({0:"a"}).isArguments()})}),it("isNotArguments()",function(){test.value([1,2,3]).isNotArguments().value({0:1,1:2,2:3}).isNotArguments().exception(function(){test.value(arguments).isNotArguments()})}),it("isTrue()",function(){test.value(!0).isTrue().exception(function(){test.value(1).isTrue()})}),it("isNotTrue()",function(){test.value(!1).isNotTrue().value(1).isNotTrue().value("1").isNotTrue().value("true").isNotTrue().exception(function(){test.value(!0).isNotTrue()})}),it("isTruthy()",function(){test.value(!0).isTruthy().value(1).isTruthy().value("ok").isTruthy().exception(function(){test.value("").isTruthy()})}),it("isNotTruthy()",function(){test.value(0).isNotTruthy().exception(function(){test.value("1").isNotTruthy()})}),it("isFalse()",function(){test.value(!1).isFalse().exception(function(){test.value(null).isFalse()})}),it("isNotFalse()",function(){test.value(!0).isNotFalse().value(0).isNotFalse().value("0").isNotFalse().value("false").isNotFalse().value(null).isNotFalse().value(void 0).isNotFalse().exception(function(){test.value(!1).isNotFalse()})}),it("isFalsy()",function(){test.value(!1).isFalsy().value(0).isFalsy().value("").isFalsy().value(null).isFalsy().value(void 0).isFalsy().exception(function(){test.value(1).isFalsy()})}),it("isNotFalsy()",function(){test.value(1).isNotFalsy().exception(function(){test.value(void 0).isNotFalsy()})}),it("isEmpty()",function(){test.value("").isEmpty().value([]).isEmpty().value({}).isEmpty().exception(function(){test.value(1).isEmpty()})}),it("isNotEmpty()",function(){test.value("a").isNotEmpty().exception(function(){test.value("").isNotEmpty()}).exception(function(){test.value({}).isNotEmpty()})}),it("isNaN()",function(){test.value(NaN).isNaN().value(new Number(NaN)).isNaN().value(NaN).isNaN().value(parseInt("a",10)).isNaN().exception(function(){test.value(1).isNaN()}).exception(function(){test.value(new Number(1)).isNaN()}).exception(function(){test.value(void 0).isNaN()}).exception(function(){test.value(null).isNaN()}).exception(function(){test.value(!1).isNaN()}).exception(function(){test.value(!0).isNaN()}).exception(function(){test.value(0).isNaN()}).exception(function(){test.value({}).isNaN()}).exception(function(){test.value([]).isNaN()})}),it("isNotNaN()",function(){test.value(1).isNotNaN().value(new Number(1)).isNotNaN().value(void 0).isNotNaN().value(null).isNotNaN().value(!1).isNotNaN().value(!0).isNotNaN().value(0).isNotNaN().value({}).isNotNaN().value([]).isNotNaN().exception(function(){test.value(NaN).isNotNaN()}).exception(function(){test.value(new Number(NaN)).isNotNaN()}).exception(function(){test.value(NaN).isNotNaN()}).exception(function(){test.value(parseInt("a",10)).isNotNaN()})}),it("exists()",function(){test.value("foobar").exists().exception(function(){test.value(null).exists()})}),it("isError() - alias of throws(Error)",function(){test.value(function(){throw new Error("Whoops!")}).isError().case("Test failure",function(){test.value(function(){test.value(function(){throw{name:"error",message:"Whoops"}}).isError()}).throws().value(function(){test.value(function(){throw Error}).isError()}).throws()})}),it("throws([constructor], [expected])",function(){var indicator;test.value(function(){throw new Error("I'm a ninja !")}).throws().throws("I'm a ninja !").throws(/ninja/).throws(Error).throws(Error,"I'm a ninja !").throws(Error,/ninja/).throws(function(err){if(err instanceof Error&&/ninja/.test(err))return indicator=!0}).then().bool(indicator).isTrue().exception(function(){test.value(function(){return!0}).throws()})}),it("hasLength(expected)",function(){test.value([1,2]).hasLength(2).value("Hello Nico").hasLength(10).exception(function(){test.value("Hello Nico").hasLength(2)})}),it("hasNotLength(expected)",function(){test.value([1,2]).hasNotLength(1).value("Hello Nico").hasNotLength(11).exception(function(){test.value("Hello Nico").hasNotLength(10)})}),it("isBetween(begin, end)",function(){test.value(2).isBetween(2,4).value(3).isBetween(2,4).value(4).isBetween(2,4).exception(function(){test.value(2).isBetween(4,2)})}),it("isNotBetween(begin, end)",function(){test.value(1).isNotBetween(2,4).value(5).isNotBetween(2,4).exception(function(){test.value(2).isNotBetween(2,2)})}),it("isBefore(expected)",function(){test.value(new Date(2010,5,20)).isBefore(new Date(2012,2,28)).exception(function(){test.value(new Date(2012,2,28)).isBefore(new Date(1982,2,17))})}),it("isAfter(expected)",function(){test.value(new Date(2012,2,28)).isAfter(new Date(2010,5,20)).exception(function(){test.value(new Date(2012,2,28)).isAfter(new Date(2014,2,28))})}),it("isLessThan(expected)",function(){test.value(1).isLessThan(2).exception(function(){test.value(1).isLessThan(.98)})}),it("isGreaterThan(expected)",function(){test.value(2).isGreaterThan(1).exception(function(){test.value(1).isGreaterThan(1.00000001)})}),it("isApprox(num, delta)",function(){test.value(99.98).isApprox(100,.1).exception(function(){test.value(99.98).isApprox(100,.01)})}),it("isInfinite()",function(){test.value(1/0).isInfinite().exception(function(){test.value(1.3333333333333333).isInfinite()})}),it("isNotInfinite()",function(){test.value(1.3333333333333333).isNotInfinite().exception(function(){test.value(1/0).isNotInfinite()})}),it("isEnumerable(property)",function(){test.value({prop:"foobar"}).isEnumerable("prop").exception(function(){test.value(function(){}).isEnumerable("call")})}),it("isNotEnumerable(property)",function(){test.value(function(){}).isNotEnumerable("call").value(Object.create({},{prop:{enumerable:0}})).isNotEnumerable("prop").exception(function(){test.value({prop:"foobar"}).isNotEnumerable("prop")})}),it("isFrozen()",function(){test.value(Object.freeze({})).isFrozen().exception(function(){test.value({}).isFrozen()})}),it("isNotFrozen()",function(){test.value({}).isNotFrozen().exception(function(){test.value(Object.freeze({})).isNotFrozen()})}),it("isInstanceOf(expected)",function(){test.value(new Date).isInstanceOf(Date).exception(function(){test.value(new Date).isInstanceOf(Array)})}),it("isNotInstanceOf(expected)",function(){test.value(new Date).isNotInstanceOf(RegExp).exception(function(){test.value(new Date).isNotInstanceOf(Object)})}),it("hasProperty(property [, value])",function(){test.value({foo:"bar"}).hasProperty("foo").value({foo:"bar"}).hasProperty("foo","bar").exception(function(){test.value({}).hasProperty("foo")})}),it("hasNotProperty(property [, value])",function(){test.value({foo:"bar"}).hasNotProperty("bar").value({foo:"bar"}).hasNotProperty("foo","baz").exception(function(){test.value({foo:"bar"}).hasNotProperty("foo")})}),it("hasOwnProperty(property [, value])",function(){test.value({foo:"bar"}).hasOwnProperty("foo").value({foo:"bar"}).hasOwnProperty("foo","bar").exception(function(){test.value(new RegExp("foo")).hasOwnProperty("constructor")})}),it("hasNotOwnProperty(property [, value])",function(){test.value({foo:"bar"}).hasNotOwnProperty("bar").value({foo:"bar"}).hasNotOwnProperty("foo","baz").exception(function(){test.value({foo:"bar"}).hasNotOwnProperty("foo")})}),it("hasProperties(properties)",function(){var obj={foo:"bar",bar:"huhu",other:"vroom"};test.value(obj).hasProperties(["other","bar","foo"]).exception(function(){test.value(obj).hasProperties(["other","bar"])})}),it("hasNotProperties(properties)",function(){var obj={foo:"bar",bar:"huhu",other:"vroom"};test.value(obj).hasNotProperties(["other","foo"]).exception(function(){test.value(obj).hasNotProperties(["other","bar","foo"])})}),it("hasOwnProperties(properties)",function(){var obj={foo:"bar",bar:"huhu",other:"vroom"};test.value(obj).hasOwnProperties(["other","bar","foo"]).exception(function(){test.value(obj).hasOwnProperties(["other","bar"])})}),it("hasKey(key [, value])",function(){test.value({foo:"bar"}).hasKey("foo").value({foo:"bar"}).hasKey("foo","bar").exception(function(){test.value({}).hasKey("foo")})}),it("notHasKey(key [, value])",function(){test.value({foo:"bar"}).notHasKey("bar").value({foo:"bar"}).notHasKey("foo","baz").exception(function(){test.value({foo:"bar"}).notHasKey("foo")})}),it("hasKeys(keys)",function(){var obj={foo:"bar",bar:"huhu",other:"vroom"};test.value(obj).hasKeys(["other","bar","foo"]).exception(function(){test.value(obj).hasKeys(["other","bar"])})}),it("notHasKeys(keys)",function(){var obj={foo:"bar",bar:"huhu",other:"vroom"};test.value(obj).notHasKeys(["other","foo"]).exception(function(){test.value(obj).notHasKeys(["other","bar","foo"])})}),it("hasValue(expected)",function(){test.value("Hello, Nico!").hasValue("Nico").value([1,42,3]).hasValue(42).value({life:42,love:69}).hasValue(42).exception(function(){test.value({life:42,love:69}).hasValue(6)})}),it("notHasValue(expected)",function(){test.value("Hello, Nico!").notHasValue("Bye").value([1,42,3]).notHasValue(4).value({life:42,love:69}).notHasValue(4).exception(function(){test.value({life:42,love:69}).notHasValue(69)})}),it("hasValues(expected)",function(){test.value([1,42,3]).hasValues([42,3]).exception(function(){test.value([1,42,3]).hasValues([42,3.01])})}),it("notHasValues(expected)",function(){test.value([1,42,3]).notHasValues([4,2]).exception(function(){test.value([1,42,3]).notHasValues([1,42,3])})}),it("contains(expected [, ...])",function(){test.value("hello boy").contains("boy").value("KISS principle : Keep it Simple, Stupid").contains("Simple","principle",":").value([1,2,3]).contains([3]).value([1,2,3]).contains([1,3]).value([1,2,3]).contains([3,1,2]).value({a:{b:10},b:{c:10,d:11,a:{b:10,c:11}}}).contains({a:{b:10},b:{c:10,a:{c:11}}}).value([1,2,3,{a:{b:{d:12}}}]).contains([2],[1,2],[{a:{b:{d:12}}}]).value([[1],[2],[3]]).contains([[3]]).value([[1],[2],[3,4]]).contains([[3]]).value([{a:"a"},{b:"b",c:"c"}]).contains([{a:"a"}],[{b:"b"}]).exception(function(){test.value([{a:"a"},{b:"b",c:"c"}]).contains([{a:"a"}],[{b:"c"}])})}),it("notContains(expected [, ...])",function(){test.value("hello boy").notContains("bye").value([[1],[2],[3,4]]).notContains([[0]]).value([{a:"a"},{b:"b",c:"c"}]).notContains([{a:"b"}],[{c:"b"}]).exception(function(){test.value([{a:"a"},{b:"b",c:"c"}]).notContains([{a:"a"},{c:"c"}])})}),it("isReverseOf(expected)",function(){test.value([1,2,3]).isReverseOf([3,2,1]).exception(function(){test.value([1,2,3]).isReverseOf([1,2,3])}).exception(function(){test.value([1,2,3]).isReverseOf([3,2,2,1])})}),it("isNotReverseOf(expected)",function(){test.value([1,2,2,3]).isNotReverseOf([3,2,1]).exception(function(){test.value([3,2,1]).isNotReverseOf([3,2,1])})}),it("startsWith(str)",function(){test.value("foobar").startsWith("foo").exception(function(){test.value("Hello the world").startsWith("world")})}),it("notStartsWith(str)",function(){test.value("foobar").notStartsWith("bar").exception(function(){test.value("Hello the world").notStartsWith("Hello")})}),it("endsWith(str)",function(){test.value("foobar").endsWith("bar").exception(function(){test.value("Hello the world").endsWith("Hello")})}),it("notEndsWith(str)",function(){test.value("foobar").notEndsWith("foo").exception(function(){test.value("Hello the world").notEndsWith("world")})}),it("hasHttpStatus(code)",function(){var req={headers:{"content-type":"application/json"},statusCode:200};test.value(req).hasHttpStatus(200).value(req).hasProperty("statusCode",200).exception(function(){test.value(req).hasHttpStatus(500)})}),it("notHasHttpStatus(code)",function(){var req={headers:{"content-type":"application/json"},statusCode:200};test.value(req).notHasHttpStatus(404).value(req).hasNotProperty("statusCode",404).exception(function(){test.value(req).notHasHttpStatus(200)})}),it("hasHeader(field [, value])",function(){var req={headers:{"content-type":"application/json"}};test.exception(function(){test.value(req).hasHeader("charset")}).exception(function(){test.value(req).hasHeader("content-type","text/html")}).value(req).hasHeader("content-type").hasHeader("content-type","application/json"),test.object(req.headers).hasProperty("content-type").string(req.headers["content-type"]).startsWith("application/json"),test.string(req.headers["content-type"]).isNotEmpty().string(req.headers["content-type"]).startsWith("application/json")}),it("notHasHeader(field [, value])",function(){var req={headers:{"content-type":"application/json"}};test.exception(function(){test.value(req).notHasHeader("content-type")}).exception(function(){test.value(req).notHasHeader("content-type","application/json")}).value(req).notHasHeader("charset").notHasHeader("content-type","text/html").value({}).notHasHeader("charset").notHasHeader("content-type","text/html").value({headers:{}}).notHasHeader("charset").notHasHeader("content-type","text/html")}),it("hasHeaderJson()",function(){var req={headers:{"content-type":"application/json"}};test.value(req).hasHeaderJson(),test.string(req.headers["content-type"]).startsWith("application/json"),test.then(req.headers["content-type"]="application/json; charset=utf-8").value(req).hasHeaderJson(),test.string(req.headers["content-type"]).startsWith("application/json"),test.then(req.headers["content-type"]="text/html").error(function(){test.value(req).hasHeaderJson()})}),it("notHasHeaderJson()",function(){var req={headers:{"content-type":"text/html"}};test.value(req).notHasHeaderJson().value({}).notHasHeaderJson(),test.value(req).notHasHeaderJson().string(req.headers["content-type"]).notStartsWith("application/json").value({}).notHasHeaderJson().then(req.headers["content-type"]="application/json").error(function(){test.value(req).notHasHeaderJson()})}),it("hasHeaderHtml()",function(){var req={headers:{"content-type":"text/html"}};test.value(req).hasHeaderHtml(),test.string(req.headers["content-type"]).startsWith("text/html"),test.then(req.headers["content-type"]="text/html; charset=utf-8").value(req).hasHeaderHtml(),test.string(req.headers["content-type"]).startsWith("text/html"),test.then(req.headers["content-type"]="application/json").error(function(){test.value(req).hasHeaderHtml()})}),it("notHasHeaderHtml()",function(){var req={headers:{"content-type":"application/json"}};test.value(req).notHasHeaderHtml().string(req.headers["content-type"]).notStartsWith("text/html").then(req.headers["content-type"]="text/html").error(function(){test.value(req).notHasHeaderHtml()})})})})}]);