Add hpDisplay function

This commit is contained in:
Blade Barringer
2015-07-18 13:12:11 -05:00
parent f9304bd28f
commit 17ef7e2885
2 changed files with 26 additions and 0 deletions

View File

@@ -15,6 +15,23 @@ describe('Stats Service', function() {
});
});
describe('hpDisplay', function() {
it('displays hp as "hp / totalHP"', function() {
var hp = 34;
var hpDisplay = statCalc.hpDisplay(hp);
expect(hpDisplay).to.eql('34/50');
});
it('Rounds hp up when given a decimal', function() {
var hp = 34.4;
var hpDisplay = statCalc.hpDisplay(hp);
expect(hpDisplay).to.eql('35/50');
});
});
describe('levelBonus', function() {
it('calculates bonus as half of level for even numbered level under 100', function() {
var level = 50;