1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00
Oinktube/node_modules/class.extend/test/class.test.js
2022-06-30 12:23:35 -03:00

42 lines
1,006 B
JavaScript

require("should");
var Class = require('../lib/class.js');
describe('Mode Parser', function() {
it('should parse 0777',function() {
var Person = Class.extend({
init: function(isDancing){
this.dancing = isDancing;
},
dance: function(){
return this.dancing;
}
});
var Ninja = Person.extend({
init: function(){
this._super( false );
},
dance: function(){
// Call the inherited version of dance()
return this._super();
},
swingSword: function(){
return true;
}
});
var p = new Person(true);
p.dance().should.be.true;
var n = new Ninja();
n.dance().should.be.false;
n.swingSword().should.be.true;
// Should all be true
(p instanceof Person).should.be.true;
(p instanceof Class).should.be.true;
(n instanceof Ninja).should.be.true;
(n instanceof Person).should.be.true;
(n instanceof Class).should.be.true;
});
});