Skip to content

Commit

Permalink
Cover low-level full mana requirement
Browse files Browse the repository at this point in the history
The problem description states: `If they player's level is below 10, their mana should be None`. One of the top results did not implement this requirement due to a missing test. 

This PR adds a test verifying that low level players get their `mana` set to `None`.
  • Loading branch information
lennnerd authored and lpil committed Mar 25, 2024
1 parent 6058b6a commit 5b30a37
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pub fn revive_a_player_that_is_alive_should_return_none_test() {
|> should.equal(None)
}

pub fn reviving_a_low_level_player_resets_its_health_to_100_test() {
Player(name: None, level: 3, health: 0, mana: None)
pub fn reviving_a_low_level_player_resets_health_and_removes_mana_test() {
Player(name: None, level: 3, health: 0, mana: Some(7))
|> role_playing_game.revive
|> should.equal(Some(Player(name: None, level: 3, health: 100, mana: None)))
}
Expand Down

0 comments on commit 5b30a37

Please sign in to comment.