flag inactive goalies in goalieName
This commit is contained in:
parent
461fb5d942
commit
7923827d22
|
@ -51,8 +51,12 @@ goalieDetails g = let
|
|||
goalieName :: Goalie -> String
|
||||
goalieName g = let
|
||||
|
||||
prefix = if g^.gActive
|
||||
then ""
|
||||
else "*"
|
||||
|
||||
suffix = if g^.gRookie
|
||||
then "*"
|
||||
else ""
|
||||
|
||||
in g^.gName ++ suffix
|
||||
in prefix ++ g^.gName ++ suffix
|
||||
|
|
|
@ -76,10 +76,16 @@ goalieNameSpec = describe "goalieName" $ mapM_
|
|||
it ("should be " ++ expected) $
|
||||
goalieName g `shouldBe` expected)
|
||||
|
||||
-- label, goalie, expected
|
||||
[ ( "rookie", goalie True, "foo*" )
|
||||
, ( "non-rookie", goalie False, "foo" )
|
||||
-- label, goalie, expected
|
||||
[ ( "rookie", rookie, "foo*" )
|
||||
, ( "non-rookie", active, "foo" )
|
||||
, ( "retired", retired, "*foo" )
|
||||
]
|
||||
|
||||
where
|
||||
goalie r = newGoalie 1 "foo" & gRookie .~ r
|
||||
rookie = goalie True True
|
||||
active = goalie False True
|
||||
retired = goalie False False
|
||||
goalie r a = newGoalie 1 "foo"
|
||||
& gRookie .~ r
|
||||
& gActive .~ a
|
||||
|
|
Loading…
Reference in New Issue
Block a user