Skip to content

Commit

Permalink
Restore checks for calculating each stat only once
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanplusplus committed Nov 14, 2023
1 parent 6689e0d commit 87bbca9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions exercises/practice/dnd-character/dnd-character_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 87bbca9

Please sign in to comment.