bugfix: increment game number in startNewGame
This commit is contained in:
parent
c95520832d
commit
02f04a3d6c
|
@ -47,7 +47,7 @@ resetYtd
|
||||||
startNewGame :: ProgState -> ProgState
|
startNewGame :: ProgState -> ProgState
|
||||||
startNewGame
|
startNewGame
|
||||||
= (progMode .~ NewGame newGameState)
|
= (progMode .~ NewGame newGameState)
|
||||||
. (database . dbGames .~ 0)
|
. (database . dbGames %~ succ)
|
||||||
|
|
||||||
-- | Sets the game type to 'HomeGame'
|
-- | Sets the game type to 'HomeGame'
|
||||||
setHomeGame :: ProgState -> ProgState
|
setHomeGame :: ProgState -> ProgState
|
||||||
|
|
|
@ -52,13 +52,10 @@ startNewSeasonSpec = describe "startNewSeason" $ do
|
||||||
|
|
||||||
startNewGameSpec :: Spec
|
startNewGameSpec :: Spec
|
||||||
startNewGameSpec = describe "startNewGame" $ do
|
startNewGameSpec = describe "startNewGame" $ do
|
||||||
let
|
let s = startNewGame newProgState
|
||||||
s = newProgState
|
|
||||||
& database . dbGames .~ 1
|
|
||||||
& startNewGame
|
|
||||||
|
|
||||||
it "should set the number of games to 0" $
|
it "should increment the number of games" $
|
||||||
s ^. database . dbGames `shouldBe` 0
|
s ^. database . dbGames `shouldBe` 1
|
||||||
|
|
||||||
it "should set the mode to NewGame" $
|
it "should set the mode to NewGame" $
|
||||||
s ^. progMode `shouldBe` NewGame newGameState
|
s ^. progMode `shouldBe` NewGame newGameState
|
||||||
|
|
Loading…
Reference in New Issue
Block a user