From 87bbca9b6bf2f49cb20c8034f30845e070fe4d32 Mon Sep 17 00:00:00 2001 From: Ryan Hartlage Date: Mon, 13 Nov 2023 19:40:14 -0500 Subject: [PATCH] Restore checks for calculating each stat only once --- exercises/practice/dnd-character/dnd-character_spec.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/exercises/practice/dnd-character/dnd-character_spec.lua b/exercises/practice/dnd-character/dnd-character_spec.lua index 25f2510f..b924c1a5 100644 --- a/exercises/practice/dnd-character/dnd-character_spec.lua +++ b/exercises/practice/dnd-character/dnd-character_spec.lua @@ -122,6 +122,7 @@ describe('dnd', function() assert.equal("integer", math.type(strength)) assert.lteq(3, strength) assert.lteq(strength, 18) + assert.equal(strength, character.strength) end) it('creates a character with valid dexterity', function() @@ -130,6 +131,7 @@ describe('dnd', function() assert.equal("integer", math.type(dexterity)) assert.lteq(3, dexterity) assert.lteq(dexterity, 18) + assert.equal(dexterity, character.dexterity) end) it('creates a character with valid constitution', function() @@ -138,6 +140,7 @@ describe('dnd', function() assert.equal("integer", math.type(constitution)) assert.lteq(3, constitution) assert.lteq(constitution, 18) + assert.equal(constitution, character.constitution) end) it('creates a character with valid intelligence', function() @@ -146,6 +149,7 @@ describe('dnd', function() assert.equal("integer", math.type(intelligence)) assert.lteq(3, intelligence) assert.lteq(intelligence, 18) + assert.equal(intelligence, character.intelligence) end) it('creates a character with valid wisdom', function() @@ -154,6 +158,7 @@ describe('dnd', function() assert.equal("integer", math.type(wisdom)) assert.lteq(3, wisdom) assert.lteq(wisdom, 18) + assert.equal(wisdom, character.wisdom) end) it('creates a character with valid charisma', function() @@ -162,6 +167,7 @@ describe('dnd', function() assert.equal("integer", math.type(charisma)) assert.lteq(3, charisma) assert.lteq(charisma, 18) + assert.equal(charisma, character.charisma) end) it('creates a character with valid hitpoints', function()