Skip to content

Commit

Permalink
Started updating the NuGet packages with version 0.2.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmohl committed Dec 26, 2011
1 parent 6b82c8d commit 307a413
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 198 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var expectThatApi;
expectThatApi = (function(expectThatApi) {
return {
version: "0.2.0.0",
version: "0.2.1.0",
init: function(assertProvider) {
var _this;
_this = this;
Expand Down Expand Up @@ -102,13 +102,19 @@
"expected": expected
};
},
extendApi: function(fn, assertProvder) {
extendApi: function(fn, assertProvder, desc) {
var description;
if (!Object.prototype.should) {
expectThatApi.init(assertProvder);
}
description = fn.toString().match(/^[^\{]*\{((.*\s*)*)\}/m)[1];
return description.replace(/(\^\s+|\s)+$/g, "").replace(/[(\^(?)]/g, " ").replace(/.should/g, " should").replace(/return/g, " ").replace(/shouldnt/g, "shouldn't").replace(/void 0/g, "null").replace(/!= null/g, "").replace(/typeof null !== "undefined" && null !== null/g, "undefined");
if (typeof desc === "function" && typeof fn !== "function") {
fn = desc;
description = fn.toString().match(/^[^\{]*\{((.*\s*)*)\}/m)[1];
description = description.replace(/(\^\s+|\s)+$/g, "").replace(/\);/g, "").replace(/[(\^(?)]/g, " ").replace(/.should/g, " should").replace(/return/g, " ").replace(/shouldnt/g, "shouldn't").replace(/void 0/g, "null").replace(/!= null/g, "").replace(/typeof null !== "undefined" && null !== null/g, "undefined");
} else {
description = desc;
}
return [fn, description];
}
};
return expectThatApi.util.extend(expectThatApi, expectThatApi.api);
Expand Down Expand Up @@ -206,11 +212,13 @@
};
expectThatApi.util.extend(expectThatApi.api.jasmine, expectThatApi.assertionProvider);
expectThatApi.api.jasmine = {
expectThat: function(fn) {
var env, testDescription;
testDescription = expectThatApi.api.extendApi(fn, expectThatApi.assertionProvider);
expectThat: function(desc, fn) {
var env, newFn, result, testDescription;
result = expectThatApi.api.extendApi(fn, expectThatApi.assertionProvider, desc);
newFn = result[0];
testDescription = result[1];
env = jasmine.getEnv();
return env.it(testDescription, fn);
return env.it(testDescription, newFn);
}
};
expectThatApi.util.extend(expectThatApi, expectThatApi.api.jasmine);
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var expectThatApi;expectThatApi=function(a){return{version:"0.2.0.0",init:function(a){var b;return b=this,Object.prototype.should=function(c){return b.evaluateAssertion(a,!0,this,c)},Object.prototype.shouldnt=function(c){return b.evaluateAssertion(a,!1,this,c)},this},executeThrowAssertion:function(a,b,c){return typeof c.expected!="undefined"?a.throwsException(b):a.throwsException()},executeEqualToAssertion:function(a,b,c){return a?b.isEqualTo(c):b.isNotEqualTo(c)},executeBooleanAssertion:function(a,b,c,d,e){var f;if(typeof d.expr!="function")throw"The provided custom assertion expression for "+d.assertionType+" is invalid.\nCustom assertion expressions should be defined as:\n(actual, expected) -> <some function using actual and expression>.";return f=e.assert(d.expr(b,c)),a?f.isTrue():f.isFalse()},executeAssertion:function(a,b,c,d,e,f,g){if(a===null||typeof a=="undefined")return;return typeof c!="undefined"?c==="throw"?this.executeThrowAssertion(a,e,f):this.executeBooleanAssertion(b,d,e,f,g):this.executeEqualToAssertion(b,a,e)},evaluateAssertion:function(a,b,c,d){var e,f,g,h;return h=d,g=d,typeof d=="function"&&(g=d()),typeof g!="undefined"&&g!==null&&(f=g.assertionType,typeof g.expected!="undefined"&&(h=g.expected)),e=a.assert(c),this.executeAssertion(e,b,f,c,h,g,a)}}}(expectThatApi||(expectThatApi={})),function(a){return a.util={extend:function(a,b){var c;for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}},this}(expectThatApi||(expectThatApi={})),function(a){return a.api={be:function(a){return a},to:function(a){return a},equal:function(a){return a},throwException:function(a){return{assertionType:"throw",expected:a}},extendApi:function(b,c){var d;return Object.prototype.should||a.init(c),d=b.toString().match(/^[^\{]*\{((.*\s*)*)\}/m)[1],d.replace(/(\^\s+|\s)+$/g,"").replace(/[(\^(?)]/g," ").replace(/.should/g," should").replace(/return/g," ").replace(/shouldnt/g,"shouldn't").replace(/void 0/g,"null").replace(/!= null/g,"").replace(/typeof null !== "undefined" && null !== null/g,"undefined")}},a.util.extend(a,a.api)}(expectThatApi||(expectThatApi={})),function(a){return a.api.extendedMatchers={greaterThan:function(a){return{assertionType:"greaterThan",expected:a,expr:function(a,b){return a>b}}},lessThan:function(a){return{assertionType:"lessThan",expected:a,expr:function(a,b){return a<b}}},greaterThanOrEqual:function(a){return{assertionType:"greaterThanOrEqual",expected:a,expr:function(a,b){return a>=b}}},lessThanOrEqual:function(a){return{assertionType:"lessThanOrEqual",expected:a,expr:function(a,b){return a<=b}}},strictlyEqual:function(a){return{assertionType:"strictlyEqual",expected:a,expr:function(a,b){return a===b}}}},a.util.extend(a,a.api.extendedMatchers)}(expectThatApi||(expectThatApi={})),function(a,b){return a.api.jasmine={},a.assertionProvider={},a.assertionProvider={assert:function(a){return this.actual=a,this},isEqualTo:function(a){return typeof a=="boolean"?expect(this.actual==a).toBeTruthy():expect(this.actual).toEqual(a)},isNotEqualTo:function(a){return typeof a=="boolean"?expect(this.actual==a).toBeFalsy():expect(this.actual).toNotEqual(a)},isTrue:function(){return expect(this.actual).toBeTruthy()},isFalse:function(){return expect(this.actual).toBeFalsy()},throwsException:function(a){try{return this.actual(),expect(!0).toBeFalsy()}catch(b){return typeof a!="undefined"&&a!==null&&a!==b?expect(!0).toBeFalsy():expect(!0).toBeTruthy()}}},a.util.extend(a.api.jasmine,a.assertionProvider),a.api.jasmine={expectThat:function(b){var c,d;return d=a.api.extendApi(b,a.assertionProvider),c=jasmine.getEnv(),c.it(d,b)}},a.util.extend(a,a.api.jasmine),b.equal=a.api.equal,b.be=a.api.be,b.to=a.api.to,b.throwException=a.api.throwException,b.expectThat=a.expectThat,a.util.extend(b,a.api.extendedMatchers),this}(expectThatApi||(expectThatApi={}),window)
var expectThatApi;expectThatApi=function(a){return{version:"0.2.1.0",init:function(a){var b;return b=this,Object.prototype.should=function(c){return b.evaluateAssertion(a,!0,this,c)},Object.prototype.shouldnt=function(c){return b.evaluateAssertion(a,!1,this,c)},this},executeThrowAssertion:function(a,b,c){return typeof c.expected!="undefined"?a.throwsException(b):a.throwsException()},executeEqualToAssertion:function(a,b,c){return a?b.isEqualTo(c):b.isNotEqualTo(c)},executeBooleanAssertion:function(a,b,c,d,e){var f;if(typeof d.expr!="function")throw"The provided custom assertion expression for "+d.assertionType+" is invalid.\nCustom assertion expressions should be defined as:\n(actual, expected) -> <some function using actual and expression>.";return f=e.assert(d.expr(b,c)),a?f.isTrue():f.isFalse()},executeAssertion:function(a,b,c,d,e,f,g){if(a===null||typeof a=="undefined")return;return typeof c!="undefined"?c==="throw"?this.executeThrowAssertion(a,e,f):this.executeBooleanAssertion(b,d,e,f,g):this.executeEqualToAssertion(b,a,e)},evaluateAssertion:function(a,b,c,d){var e,f,g,h;return h=d,g=d,typeof d=="function"&&(g=d()),typeof g!="undefined"&&g!==null&&(f=g.assertionType,typeof g.expected!="undefined"&&(h=g.expected)),e=a.assert(c),this.executeAssertion(e,b,f,c,h,g,a)}}}(expectThatApi||(expectThatApi={})),function(a){return a.util={extend:function(a,b){var c;for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}},this}(expectThatApi||(expectThatApi={})),function(a){return a.api={be:function(a){return a},to:function(a){return a},equal:function(a){return a},throwException:function(a){return{assertionType:"throw",expected:a}},extendApi:function(b,c,d){var e;return Object.prototype.should||a.init(c),typeof d=="function"&&typeof b!="function"?(b=d,e=b.toString().match(/^[^\{]*\{((.*\s*)*)\}/m)[1],e=e.replace(/(\^\s+|\s)+$/g,"").replace(/\);/g,"").replace(/[(\^(?)]/g," ").replace(/.should/g," should").replace(/return/g," ").replace(/shouldnt/g,"shouldn't").replace(/void 0/g,"null").replace(/!= null/g,"").replace(/typeof null !== "undefined" && null !== null/g,"undefined")):e=d,[b,e]}},a.util.extend(a,a.api)}(expectThatApi||(expectThatApi={})),function(a){return a.api.extendedMatchers={greaterThan:function(a){return{assertionType:"greaterThan",expected:a,expr:function(a,b){return a>b}}},lessThan:function(a){return{assertionType:"lessThan",expected:a,expr:function(a,b){return a<b}}},greaterThanOrEqual:function(a){return{assertionType:"greaterThanOrEqual",expected:a,expr:function(a,b){return a>=b}}},lessThanOrEqual:function(a){return{assertionType:"lessThanOrEqual",expected:a,expr:function(a,b){return a<=b}}},strictlyEqual:function(a){return{assertionType:"strictlyEqual",expected:a,expr:function(a,b){return a===b}}}},a.util.extend(a,a.api.extendedMatchers)}(expectThatApi||(expectThatApi={})),function(a,b){return a.api.jasmine={},a.assertionProvider={},a.assertionProvider={assert:function(a){return this.actual=a,this},isEqualTo:function(a){return typeof a=="boolean"?expect(this.actual==a).toBeTruthy():expect(this.actual).toEqual(a)},isNotEqualTo:function(a){return typeof a=="boolean"?expect(this.actual==a).toBeFalsy():expect(this.actual).toNotEqual(a)},isTrue:function(){return expect(this.actual).toBeTruthy()},isFalse:function(){return expect(this.actual).toBeFalsy()},throwsException:function(a){try{return this.actual(),expect(!0).toBeFalsy()}catch(b){return typeof a!="undefined"&&a!==null&&a!==b?expect(!0).toBeFalsy():expect(!0).toBeTruthy()}}},a.util.extend(a.api.jasmine,a.assertionProvider),a.api.jasmine={expectThat:function(b,c){var d,e,f,g;return f=a.api.extendApi(c,a.assertionProvider,b),e=f[0],g=f[1],d=jasmine.getEnv(),d.it(g,e)}},a.util.extend(a,a.api.jasmine),b.equal=a.api.equal,b.be=a.api.be,b.to=a.api.to,b.throwException=a.api.throwException,b.expectThat=a.expectThat,a.util.extend(b,a.api.extendedMatchers),this}(expectThatApi||(expectThatApi={}),window)
Binary file not shown.
2 changes: 1 addition & 1 deletion NuGet/ExpectThat.Jasmine/ExpectThat.Jasmine.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>ExpectThat.Jasmine</id>
<version>0.2.0.2</version>
<version>0.2.1.0</version>
<authors>Daniel Mohl</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>ExpectThat for Jasmine is an expressive, self-documenting assertion library for CoffeScript/JavaScript.</description>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var expectThatApi;expectThatApi=function(a){return{version:"0.2.1.0",init:function(a){var b;return b=this,Object.prototype.should=function(c){return b.evaluateAssertion(a,!0,this,c)},Object.prototype.shouldnt=function(c){return b.evaluateAssertion(a,!1,this,c)},this},executeThrowAssertion:function(a,b,c){return typeof c.expected!="undefined"?a.throwsException(b):a.throwsException()},executeEqualToAssertion:function(a,b,c){return a?b.isEqualTo(c):b.isNotEqualTo(c)},executeBooleanAssertion:function(a,b,c,d,e){var f;if(typeof d.expr!="function")throw"The provided custom assertion expression for "+d.assertionType+" is invalid.\nCustom assertion expressions should be defined as:\n(actual, expected) -> <some function using actual and expression>.";return f=e.assert(d.expr(b,c)),a?f.isTrue():f.isFalse()},executeAssertion:function(a,b,c,d,e,f,g){if(a===null||typeof a=="undefined")return;return typeof c!="undefined"?c==="throw"?this.executeThrowAssertion(a,e,f):this.executeBooleanAssertion(b,d,e,f,g):this.executeEqualToAssertion(b,a,e)},evaluateAssertion:function(a,b,c,d){var e,f,g,h;return h=d,g=d,typeof d=="function"&&(g=d()),typeof g!="undefined"&&g!==null&&(f=g.assertionType,typeof g.expected!="undefined"&&(h=g.expected)),e=a.assert(c),this.executeAssertion(e,b,f,c,h,g,a)}}}(expectThatApi||(expectThatApi={})),function(a){return a.util={extend:function(a,b){var c;for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}},this}(expectThatApi||(expectThatApi={})),function(a){return a.api={be:function(a){return a},to:function(a){return a},equal:function(a){return a},throwException:function(a){return{assertionType:"throw",expected:a}},extendApi:function(b,c,d){var e;return Object.prototype.should||a.init(c),typeof d=="function"&&typeof b!="function"?(b=d,e=b.toString().match(/^[^\{]*\{((.*\s*)*)\}/m)[1],e=e.replace(/(\^\s+|\s)+$/g,"").replace(/\);/g,"").replace(/[(\^(?)]/g," ").replace(/.should/g," should").replace(/return/g," ").replace(/shouldnt/g,"shouldn't").replace(/void 0/g,"null").replace(/!= null/g,"").replace(/typeof null !== "undefined" && null !== null/g,"undefined")):e=d,[b,e]}},a.util.extend(a,a.api)}(expectThatApi||(expectThatApi={})),function(a){return a.api.extendedMatchers={greaterThan:function(a){return{assertionType:"greaterThan",expected:a,expr:function(a,b){return a>b}}},lessThan:function(a){return{assertionType:"lessThan",expected:a,expr:function(a,b){return a<b}}},greaterThanOrEqual:function(a){return{assertionType:"greaterThanOrEqual",expected:a,expr:function(a,b){return a>=b}}},lessThanOrEqual:function(a){return{assertionType:"lessThanOrEqual",expected:a,expr:function(a,b){return a<=b}}},strictlyEqual:function(a){return{assertionType:"strictlyEqual",expected:a,expr:function(a,b){return a===b}}}},a.util.extend(a,a.api.extendedMatchers)}(expectThatApi||(expectThatApi={})),function(a,b){return a.api.jasmine={},a.assertionProvider={},a.assertionProvider={assert:function(a){return this.actual=a,this},isEqualTo:function(a){return typeof a=="boolean"?expect(this.actual==a).toBeTruthy():expect(this.actual).toEqual(a)},isNotEqualTo:function(a){return typeof a=="boolean"?expect(this.actual==a).toBeFalsy():expect(this.actual).toNotEqual(a)},isTrue:function(){return expect(this.actual).toBeTruthy()},isFalse:function(){return expect(this.actual).toBeFalsy()},throwsException:function(a){try{return this.actual(),expect(!0).toBeFalsy()}catch(b){return typeof a!="undefined"&&a!==null&&a!==b?expect(!0).toBeFalsy():expect(!0).toBeTruthy()}}},a.util.extend(a.api.jasmine,a.assertionProvider),a.api.jasmine={expectThat:function(b,c){var d,e,f,g;return f=a.api.extendApi(c,a.assertionProvider,b),e=f[0],g=f[1],d=jasmine.getEnv(),d.it(g,e)}},a.util.extend(a,a.api.jasmine),b.equal=a.api.equal,b.be=a.api.be,b.to=a.api.to,b.throwException=a.api.throwException,b.expectThat=a.expectThat,a.util.extend(b,a.api.extendedMatchers),this}(expectThatApi||(expectThatApi={}),window)
Loading

0 comments on commit 307a413

Please sign in to comment.