diff --git a/test/TypesSpec.hs b/test/TypesSpec.hs index 8c03628..ce9003e 100644 --- a/test/TypesSpec.hs +++ b/test/TypesSpec.hs @@ -40,10 +40,10 @@ spec = describe "Mtlstats.Types" $ do goalieSpec gameStatsSpec databaseSpec - pPointsSpec gameStateLSpec teamScoreSpec otherScoreSpec + pPointsSpec Menu.spec playerSpec :: Spec @@ -59,24 +59,6 @@ gameStatsSpec = describe "GameStats" $ databaseSpec :: Spec databaseSpec = describe "Database" $ jsonSpec db dbJSON -pPointsSpec :: Spec -pPointsSpec = describe "pPoints" $ mapM_ - (\(goals, assists, points) -> let - desc = "goals: " ++ show goals ++ - ", assists: " ++ show assists - stats = newPlayerStats & - psGoals .~ goals & - psAssists .~ assists - in context desc $ - it ("should be " ++ show points) $ - pPoints stats `shouldBe` points) - -- goals, assists, points - [ ( 0, 0, 0 ) - , ( 1, 0, 1 ) - , ( 0, 1, 1 ) - , ( 2, 3, 5 ) - ] - gameStateLSpec :: Spec gameStateLSpec = describe "gameStateL" $ lensSpec gameStateL -- getters @@ -260,3 +242,21 @@ dbJSON = Object $ HM.fromList , ( "home_game_stats", gameStatsJSON 1 ) , ( "away_game_stats", gameStatsJSON 2 ) ] + +pPointsSpec :: Spec +pPointsSpec = describe "pPoints" $ mapM_ + (\(goals, assists, points) -> let + desc = "goals: " ++ show goals ++ + ", assists: " ++ show assists + stats = newPlayerStats & + psGoals .~ goals & + psAssists .~ assists + in context desc $ + it ("should be " ++ show points) $ + pPoints stats `shouldBe` points) + -- goals, assists, points + [ ( 0, 0, 0 ) + , ( 1, 0, 1 ) + , ( 0, 1, 1 ) + , ( 2, 3, 5 ) + ]