Created
February 13, 2014 19:31
-
-
Save dcorns/8982115 to your computer and use it in GitHub Desktop.
Simple Encapsulated Object and test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Constructor | |
var Card=function(rank,suite){ | |
function constructor(){}; | |
constructor.prototype.getRank=function(){ | |
return rank; | |
}; | |
constructor.prototype.getSuite=function(){ | |
return suite; | |
}; | |
return new contructor(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var expect=require('chai').expect; | |
var PlayingCard=require('../lib/PlayingCard.js'); | |
describe('PlayingCard',function(){ | |
describe('Card',function(){ | |
describe('Constructor',function(){ | |
it('Should have Suite and Rank Properties',function(){ | |
var args=['Suite=Diamonds','Rank=8']; | |
expect(Suite='Diamonds'); | |
expect(Rank=8); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment