forked from LibreGaming/matchbot
Add function with tests to remove game
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
This commit is contained in:
parent
a1e7af5a26
commit
f85458340c
|
@ -11,3 +11,6 @@
|
|||
|
||||
(defn remove-player-of-game [state game player]
|
||||
(update-in state [:games game] #(disj % player)))
|
||||
|
||||
(defn remove-game [state game]
|
||||
(update-in state [:games] dissoc game))
|
||||
|
|
|
@ -23,3 +23,8 @@
|
|||
(is (=
|
||||
'#{"player-one" "player-three"}
|
||||
(get-in (remove-player-of-game test-state :imaginary-rpg "player-four") [:games :imaginary-rpg]))))
|
||||
|
||||
(deftest remove-game-test
|
||||
(is (=
|
||||
'#{:hypothetical-shooter :imaginary-rpg}
|
||||
(set (keys (:games (remove-game test-state :quasi-rts)))))))
|
||||
|
|
Loading…
Reference in New Issue