Skip to content

Instantly share code, notes, and snippets.

@dcorns
Created February 13, 2014 19:31
Show Gist options
  • Save dcorns/8982115 to your computer and use it in GitHub Desktop.
Save dcorns/8982115 to your computer and use it in GitHub Desktop.
Simple Encapsulated Object and test
//Constructor
var Card=function(rank,suite){
function constructor(){};
constructor.prototype.getRank=function(){
return rank;
};
constructor.prototype.getSuite=function(){
return suite;
};
return new contructor();
}
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