implemented playerSummary

This commit is contained in:
Jonathan Lamothe 2019-10-02 01:31:07 -04:00
parent 2be7d2bf1d
commit 4f70c84c6b
2 changed files with 8 additions and 1 deletions

View File

@ -717,4 +717,5 @@ modifyPlayer f n = map
-- | Provides a short summary string for a player
playerSummary :: Player -> String
playerSummary = undefined
playerSummary p =
p^.pName ++ " (" ++ show (p^.pNumber) ++ ") " ++ p^.pPosition

View File

@ -58,6 +58,7 @@ spec = describe "Mtlstats.Types" $ do
playerSearchSpec
playerSearchExactSpec
modifyPlayerSpec
playerSummarySpec
Menu.spec
playerSpec :: Spec
@ -578,6 +579,11 @@ modifyPlayerSpec = describe "modifyPlayer" $ mapM_
, ( "Sam", 0, 0, 0 )
]
playerSummarySpec :: Spec
playerSummarySpec = describe "playerSummary" $
it "should be \"Joe (2) center\"" $
playerSummary joe `shouldBe` "Joe (2) center"
joe :: Player
joe = newPlayer 2 "Joe" "center"