added _otherTeam with its associated lenses

This commit is contained in:
Jonathan Lamothe
2019-08-25 09:23:59 -04:00
parent 2a2189c7d1
commit 0f9f76ce4e
2 changed files with 41 additions and 0 deletions

View File

@@ -39,6 +39,7 @@ spec = describe "Mtlstats.Types" $ do
goalieSpec
databaseSpec
gameTypeLSpec
otherTeamLSpec
homeScoreLSpec
awayScoreLSpec
teamScoreSpec
@@ -130,6 +131,32 @@ gameTypeLSpec = describe "gameTypeL" $ do
in m ^. gameTypeL `shouldBe` Just t)
[HomeGame, AwayGame]
otherTeamLSpec :: Spec
otherTeamLSpec = describe "otherTeamL" $ do
context "getter" $ do
context "unexpected mode" $
it "should return an empty string" $
MainMenu ^. otherTeamL `shouldBe` ""
context "expected mode" $
it "should return \"foo\"" $ let
m = NewGame $ newGameState & otherTeam .~ "foo"
in m ^. otherTeamL `shouldBe` "foo"
context "setter" $ do
context "unexpected mode" $
it "should set the value" $ let
m = MainMenu & otherTeamL .~ "foo"
in m ^. otherTeamL `shouldBe` "foo"
context "expected mode" $
it "should set the value" $ let
m = NewGame newGameState & otherTeamL .~ "foo"
in m ^. otherTeamL `shouldBe` "foo"
homeScoreLSpec :: Spec
homeScoreLSpec = describe "homeScoreL" $ do