Skip to content

Commit

Permalink
added some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pocesar committed Jun 1, 2014
1 parent b86aab7 commit 5bf6e1e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jsdoc.conf.json
Expand Up @@ -18,7 +18,7 @@
"dateFormat" : "DD / MM / YYYY",
"outputSourceFiles": false,
"outputSourcePath" : false,
"systemName" : "ES5Class",
"systemName" : "Prototypal class inheritance for Node.js and the browser",
"footer" : "",
"copyright" : "",
"navType" : "inline",
Expand Down
27 changes: 27 additions & 0 deletions test/class-test.js
Expand Up @@ -1578,6 +1578,33 @@ describe('ES5Class', function (){

});

it('toString and valueOf', function(){
var Cls = ES5Class.$define('Cls', {
toString: function(){
return 'prototype';
}
}, {
toString: function(){
return 'static';
}
});

expect('' + Cls()).to.be('prototype');
expect('' + Cls).to.be('static');
Cls.$implement({
valueOf: function(){
return 'static valueOf';
}
});
Cls.$include({
valueOf: function(){
return 'prototype valueOf';
}
});
expect('' + Cls()).to.be('prototype valueOf');
expect('' + Cls).to.be('static valueOf');
});

it('constructor', function (){
expect(typeof Bird).to.be('function');
expect(Bird.$create).to.be.a('function');
Expand Down

0 comments on commit 5bf6e1e

Please sign in to comment.