renaned setGoalieNumber to editGoalieNumber

This commit is contained in:
Jonathan Lamothe 2019-11-13 11:06:12 -05:00
parent 0b3d70e7c3
commit 6c4b08bfcd
3 changed files with 9 additions and 9 deletions

View File

@ -20,7 +20,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
-}
module Mtlstats.Actions.EditGoalie
( setGoalieNumber
( editGoalieNumber
) where
import Control.Monad (void)
@ -30,13 +30,13 @@ import Lens.Micro ((^.), (&), (.~), (%~))
import Mtlstats.Types
import Mtlstats.Util
-- | Sets a goalie's number
setGoalieNumber
-- | Edits a goalie's number
editGoalieNumber
:: Int
-- ^ New goalie number
-> ProgState
-> ProgState
setGoalieNumber n s = fromMaybe s $ do
editGoalieNumber n s = fromMaybe s $ do
gid <- s^.progMode.editGoalieStateL.egsSelectedGoalie
void $ nth gid $ s^.database.dbGoalies
let updateGoalie = gNumber .~ n

View File

@ -39,4 +39,4 @@ goalieToEditPrompt = selectGoaliePrompt "Goalie to edit: " $
-- | Prompt to edit a goalie's number
editGoalieNumberPrompt :: Prompt
editGoalieNumberPrompt = numPrompt "Goalie number: " $
modify . setGoalieNumber
modify . editGoalieNumber

View File

@ -31,10 +31,10 @@ import Mtlstats.Util
spec :: Spec
spec = describe "EditGoalie"
setGoalieNumberSpec
editGoalieNumberSpec
setGoalieNumberSpec :: Spec
setGoalieNumberSpec = describe "setGoalieNumber" $ do
editGoalieNumberSpec :: Spec
editGoalieNumberSpec = describe "editGoalieNumber" $ do
let
joe = newGoalie 2 "Joe"
bob = newGoalie 3 "Bob"
@ -43,7 +43,7 @@ setGoalieNumberSpec = describe "setGoalieNumber" $ do
progState m = newProgState
& progMode .~ m
& database .~ db
& setGoalieNumber 5
& editGoalieNumber 5
mapM_
(\(setLabel, setGid, mode, joeData, bobData) -> context setLabel $ do