implemented goalieSummary

This commit is contained in:
Jonathan Lamothe 2019-10-30 23:27:38 -04:00
parent 12c8d0bdd6
commit 1c692a21f0
2 changed files with 7 additions and 1 deletions

View File

@ -863,4 +863,4 @@ goalieSearchExact sStr goalies = let
-- | Provides a description string for a 'Goalie'
goalieSummary :: Goalie -> String
goalieSummary = undefined
goalieSummary g = g^.gName ++ " (" ++ show (g^.gNumber) ++ ")"

View File

@ -67,6 +67,7 @@ spec = describe "Mtlstats.Types" $ do
addPlayerStatsSpec
goalieSearchSpec
goalieSearchExactSpec
goalieSummarySpec
Menu.spec
playerSpec :: Spec
@ -699,6 +700,11 @@ goalieSearchExactSpec = describe "goalieSearchExact" $ do
it "should return Nothing" $
goalieSearchExact "Greg" goalies `shouldBe` Nothing
goalieSummarySpec :: Spec
goalieSummarySpec = describe "goalieSummary" $
it "should provide a summary string" $
goalieSummary (newGoalie 2 "Joe") `shouldBe` "Joe (2)"
joe :: Player
joe = newPlayer 2 "Joe" "center"