From 45e0a6b97c156bd38af1dab2ac1f8c15d3e4f5f6 Mon Sep 17 00:00:00 2001 From: Stevan Andjelkovic Date: Mon, 18 Nov 2024 15:30:57 +0100 Subject: [PATCH] fix: return 404 on no matching ops in the mock --- src/Spex/Mock.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Spex/Mock.hs b/src/Spex/Mock.hs index 246efbf..cf70360 100644 --- a/src/Spex/Mock.hs +++ b/src/Spex/Mock.hs @@ -59,6 +59,7 @@ matchOp ctx req = let ops' = filter (\op -> op.method `methodsMatch` requestMethod req) ctx ops'' = filter (\op -> op.path `pathMatch` pathInfo req) ops' in case ops'' of + [] -> Nothing [op] -> Just (op.responseType) _ -> -- XXX: we should check for this when checking the spec...