summaryrefslogtreecommitdiff
path: root/lambda-calcul/haskell/test
diff options
context:
space:
mode:
Diffstat (limited to 'lambda-calcul/haskell/test')
-rw-r--r--lambda-calcul/haskell/test/Minilang/ServerSpec.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/lambda-calcul/haskell/test/Minilang/ServerSpec.hs b/lambda-calcul/haskell/test/Minilang/ServerSpec.hs
new file mode 100644
index 0000000..309ded8
--- /dev/null
+++ b/lambda-calcul/haskell/test/Minilang/ServerSpec.hs
@@ -0,0 +1,15 @@
+module Minilang.ServerSpec where
+
+import Minilang.Server (serveAPI)
+import Network.Wai (Application)
+import Test.Hspec (Spec, it)
+import Test.Hspec.Wai (get, shouldRespondWith, with)
+
+spec :: Spec
+spec = with app $
+ it "GET /api/leaderboard returns empty list of scores" $ do
+ get "/api/leaderboard"
+ `shouldRespondWith` "[]"
+
+app :: IO Application
+app = pure serveAPI